Skip to content

test: avoid newline-specific assertions in formatting e2e test - #34556

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:test/fix-formatting-e2e-windows
Oct 28, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:test/fix-formatting-e2e-windows

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Avoid hardcoding LF (\n) line endings in formatting.ts assertions so the test passes on Windows CI where CRLF (\r\n) line endings may be emitted.

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Oct 28, 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 removes trailing newline characters from assertions in the formatting end-to-end tests. The reviewer identified that removing these checks weakens the assertions, as they may falsely pass even if semicolons are not correctly removed by the formatters. To address this, the reviewer suggested using regular expressions that strictly assert the presence or absence of semicolons while safely supporting both LF and CRLF line endings.

Comment thread tests/e2e/tests/generate/formatting.ts
Comment thread tests/e2e/tests/generate/formatting.ts
Comment thread tests/e2e/tests/generate/formatting.ts
Comment thread tests/e2e/tests/generate/formatting.ts
Avoid hardcoding LF (`\n`) line endings in `formatting.ts` assertions so the test passes on Windows CI where CRLF (`\r\n`) line endings may be emitted.
@alan-agius4
alan-agius4 force-pushed the test/fix-formatting-e2e-windows branch from 0fc4a23 to 7c509f8 Compare October 28, 2026 09:46
@alan-agius4
alan-agius4 merged commit a0c1cea into angular:main Oct 28, 2026
27 of 39 checks passed
@alan-agius4
alan-agius4 deleted the test/fix-formatting-e2e-windows branch October 28, 2026 09:58
@alan-agius4

Copy link
Copy Markdown
Collaborator 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: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants