Skip to content

test(@angular/build): add E2E test for Vitest browser mode with coverage#33058

Open
clydin wants to merge 2 commits intoangular:mainfrom
clydin:test/vitest-browser-coverage
Open

test(@angular/build): add E2E test for Vitest browser mode with coverage#33058
clydin wants to merge 2 commits intoangular:mainfrom
clydin:test/vitest-browser-coverage

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Apr 27, 2026

This test ensures that stack traces map correctly to source files and that coverage reports are generated when running Vitest in browser mode with coverage enabled. This provides validation for the current implementation and will help verify future refactors removing the source-map-support dependency.

@clydin clydin force-pushed the test/vitest-browser-coverage branch 4 times, most recently from 7dd4c17 to 0effc83 Compare April 27, 2026 17:37
This test ensures that stack traces map correctly to source files and that coverage reports are generated when running Vitest in browser mode with coverage enabled. This provides validation for the current implementation and will help verify future refactors removing the source-map-support dependency.
@clydin clydin force-pushed the test/vitest-browser-coverage branch 2 times, most recently from 0005549 to c5e3213 Compare April 27, 2026 20:44
@clydin clydin added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Apr 27, 2026
@clydin clydin marked this pull request as ready for review April 27, 2026 21:14
Copy link
Copy Markdown

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

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 the browser source map support plugin and its associated logic from the Vitest builder configuration, while also updating the sourcemap adjustment logic. Additionally, a new E2E test has been added to verify browser coverage. I have no feedback to provide on the code changes themselves, but please address the versioning issue identified in the E2E test file.

Comment thread tests/e2e/tests/vitest/browser-coverage-sourcemaps.ts
@clydin clydin requested a review from alan-agius4 April 27, 2026 21:20
@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 Apr 28, 2026
This change removes the injection of `source-map-support` in Vitest browser tests and enables sourcemap rebasing for coverage runs as well. This allows Vitest's native remapper to handle stack traces and coverage correctly without needing the external polyfill in the browser. The E2E tests have been verified to pass with these changes. The unused `createSourcemapSupportPlugin` function has also been removed.
@clydin clydin force-pushed the test/vitest-browser-coverage branch from c5e3213 to 170f400 Compare April 28, 2026 17:19
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 area: @angular/build target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants