Skip to content

test: stabilize Vitest snapshot E2E test on Windows #31796

Merged
hybrist merged 1 commit intoangular:mainfrom
clydin:test/workaround-windows-e2e
Nov 14, 2025
Merged

test: stabilize Vitest snapshot E2E test on Windows #31796
hybrist merged 1 commit intoangular:mainfrom
clydin:test/workaround-windows-e2e

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
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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