Skip to content

test: verify snapshot updates in the Vitest snapshot e2e test - #34710

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:vitest-snapshot-update-e2e
Nov 13, 2026
Merged

clydin merged 1 commit into
angular:mainfrom
clydin:vitest-snapshot-update-e2e

Conversation

@clydin

@clydin clydin commented Nov 12, 2026

Copy link
Copy Markdown
Member

Extends the Vitest snapshot e2e test to cover updating existing snapshots after a mismatch. Vitest reads the UPDATE_SNAPSHOT environment variable directly, which is currently the way to request an update through ng test without a Vitest configuration file since the builder does not forward the --update flag.

The test now verifies that both the file snapshot and the inline snapshot are rewritten on disk with the new output and that a subsequent run passes without any further snapshot changes.

@clydin
clydin force-pushed the vitest-snapshot-update-e2e branch from cc121c5 to 9779c78 Compare November 13, 2026 14:23
Extends the Vitest snapshot e2e test to cover updating existing snapshots
after a mismatch. Vitest reads the `UPDATE_SNAPSHOT` environment variable
directly, which is currently the way to request an update through `ng test`
without a Vitest configuration file since the builder does not forward the
`--update` flag.

The test now verifies that both the file snapshot and the inline snapshot
are rewritten on disk with the new output and that a subsequent run passes
without any further snapshot changes.
@clydin
clydin force-pushed the vitest-snapshot-update-e2e branch from 9779c78 to c30c5cb Compare November 13, 2026 14:51
@clydin
clydin marked this pull request as ready for review November 13, 2026 15:04
@clydin
clydin requested a review from alan-agius4 November 13, 2026 15:04
@clydin clydin added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Nov 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Vitest snapshot end-to-end test in tests/e2e/tests/vitest/snapshot.ts. It modifies the test to break snapshots using a prefix-preserving string so that substring assertions still pass, and then adds assertions to verify that snapshots can be successfully updated using the UPDATE_SNAPSHOT environment variable. Finally, it ensures that subsequent test runs pass without further modifying the snapshots. There are no review comments, so I have no feedback to provide.

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 13, 2026
@clydin
clydin merged commit 8b26efa into angular:main Nov 13, 2026
43 checks passed
@clydin

clydin commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants