Open
Conversation
There was a problem hiding this comment.
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
scaffoldAsynctest helper that captures/normalizes CLI stdout and snapshots it. - Refactored template scaffolding tests to use Rushstack
FileSystemAPIs and parameterized Jest tests. - Cleaned up
CreateActioninternals (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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Cleans up a few things and tracks console output during tests.
How was this tested?
Built and ran tests.
Type of change