Skip to content

test(@angular/build): verify coverage ignore comments are preserved during compilation#32899

Draft
clydin wants to merge 2 commits intoangular:mainfrom
clydin:vitest/coverage-tests
Draft

test(@angular/build): verify coverage ignore comments are preserved during compilation#32899
clydin wants to merge 2 commits intoangular:mainfrom
clydin:vitest/coverage-tests

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Mar 30, 2026

The underlying Vitest coverage engine depends on specific developer comments like /* istanbul ignore next */ or /* v8 ignore next */ being present in the executing code to accurately isolate unmeasured blocks.

This commit adds strict behavioral tests to assert that the Angular CLI's in-memory compilation pipeline (via esbuild) properly preserves these structural comments and forwards them reliably to Vitest's coverage processing engine.

@clydin clydin force-pushed the vitest/coverage-tests branch 7 times, most recently from 6af4619 to bf91489 Compare April 1, 2026 21:22
When script optimization is disabled, set esbuild `legalComments` to 'inline'
to prevent it from moving ignore comments to the end of the file. This ensures
that coverage tools (like Istanbul and V8) can find the comments in place
and correctly associate them with the code they are supposed to ignore.
@clydin clydin force-pushed the vitest/coverage-tests branch 5 times, most recently from 715bca2 to aa96e44 Compare April 2, 2026 14:03
…uring compilation

The underlying Vitest coverage engine depends on specific developer comments like `/* istanbul ignore next */` or `/* v8 ignore next */` being present in the executing code to accurately isolate unmeasured blocks.

This commit adds strict behavioral tests to assert that the Angular CLI's in-memory compilation pipeline (via esbuild) properly preserves these structural comments and forwards them reliably to Vitest's coverage processing engine.
@clydin clydin force-pushed the vitest/coverage-tests branch from aa96e44 to 7d98382 Compare April 2, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant