Skip to content

General cleanup.#152

Open
iclanton wants to merge 14 commits intoSharePoint:mainfrom
iclanton:cleanup
Open

General cleanup.#152
iclanton wants to merge 14 commits intoSharePoint:mainfrom
iclanton:cleanup

Conversation

@iclanton
Copy link
Contributor

Description

Cleans up a few things and tracks console output during tests.

How was this tested?

Built and ran tests.

Type of change

  • Bug fix
  • New feature / enhancement
  • Template change
  • Documentation / CI / governance

Copilot AI review requested due to automatic review settings March 19, 2026 21:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR focuses on cleanup and improving test diagnostics by capturing scaffolding CLI output in snapshots, while also refactoring parts of the SPFx CLI’s create action and its tests.

Changes:

  • Added shared scaffoldAsync test helper that captures/normalizes CLI stdout and snapshots it.
  • Refactored template scaffolding tests to use Rushstack FileSystem APIs and parameterized Jest tests.
  • Cleaned up CreateAction internals (parameter naming, env var constant, sorted file-change output) and updated unit tests/snapshots accordingly.

Reviewed changes

Copilot reviewed 10 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/spfx-template-test/src/tests/testUtilities.ts New helper to run the CLI and snapshot normalized stdout.
tests/spfx-template-test/src/tests/templates.test.ts Refactors template scaffolding test flow and filesystem interactions; adopts stdout snapshotting.
tests/spfx-template-test/src/tests/multi-component.test.ts Switches to shared scaffold helper and async FS reads.
tests/spfx-template-test/src/tests/snapshots/templates.test.ts.snap New snapshots for CLI stdout during scaffolding tests.
tests/spfx-template-test/src/tests/snapshots/multi-component.test.ts.snap Adds stdout snapshots for multi-component scaffolding.
examples/**/teams/*.png Example output updates (binary artifacts) from scaffolding runs.
common/changes/@microsoft/spfx-cli/cleanup_2026-03-19-20-26.json Change file entry for the cleanup work.
apps/spfx-cli/src/utilities/validation.ts Introduces shared SOLUTION_NAME_PATTERN constant.
apps/spfx-cli/src/cli/actions/CreateAction.ts Refactors parameter fields, adds env var constant, and sorts reported file changes.
apps/spfx-cli/src/cli/actions/tests/CreateAction.test.ts Updates tests to new imports/env var constant and snapshots terminal output.
apps/spfx-cli/src/cli/actions/tests/snapshots/CreateAction.test.ts.snap New/updated snapshots for CreateAction tests.
.vscode/launch.json Adds VS Code debug configuration for running a selected test file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iclanton iclanton enabled auto-merge (squash) March 20, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants