Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Nov 13, 2025

This commit introduces several changes to fix a non-deterministic E2E test for Vitest snapshots that was failing on Windows.

The primary fix is to standardize the line endings of the test spec file to LF (\n) before running the test. This works around an issue where Vitest can miscalculate line counts when encountering mixed line endings (CRLF and LF), which is common in Windows environments.

Additionally, the snapshot content assertion has been updated to match Vitest's current format, which includes the test suite name. The file modification logic was also refactored to use replaceInFile for better reliability.

@clydin clydin force-pushed the test/workaround-windows-e2e branch 13 times, most recently from fea1f13 to 842c8ef Compare November 13, 2025 23:07
This commit introduces several changes to fix a non-deterministic E2E test for Vitest snapshots that was failing on Windows.

The primary fix is to standardize the line endings of the test spec file to LF (`\n`) before running the test. This works around an issue where Vitest can miscalculate line counts when encountering mixed line endings (CRLF and LF), which is common in Windows environments.

Additionally, the snapshot content assertion has been updated to match Vitest's current format, which includes the test suite name. The file modification logic was also refactored to use `replaceInFile` for better reliability.
@clydin clydin force-pushed the test/workaround-windows-e2e branch from 842c8ef to 2280a0a Compare November 13, 2025 23:45
@clydin clydin changed the title test: attempt to workaround Windows snapshot E2E flakes test: stabilize Vitest snapshot E2E test on Windows Nov 13, 2025
@clydin clydin marked this pull request as ready for review November 13, 2025 23:46
@clydin clydin added target: rc This PR is targeted for the next release-candidate action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 13, 2025
@hybrist hybrist 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 14, 2025
@hybrist hybrist merged commit 8bde4a3 into angular:main Nov 14, 2025
59 of 60 checks passed
@hybrist
Copy link
Contributor

hybrist commented Nov 14, 2025

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

@clydin clydin deleted the test/workaround-windows-e2e branch November 14, 2025 14:36
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: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants