Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 212a7bb

Browse filesBrowse files
committed
fix(@angular/build): favor istanbul coverage provider when browser testing is enabled
When browser testing is enabled (`browsers` option configured), using V8 coverage in Chromium requires fetching and remapping source maps over CDP/HTTP for every script loaded in the browser window, causing multi-minute delays during report generation on large projects. This change updates `determineCoverageProvider` to favor `@vitest/coverage-istanbul` when browser mode is active and `@vitest/coverage-istanbul` is installed in `node_modules`. Istanbul instruments code at build time, allowing instant coverage extraction from `window.__coverage__` without CDP sourcemap resolution overhead. Explicit `coverage.provider` settings in user configuration remain fully respected. Relates to #31724 (cherry picked from commit 9a3c34b)
1 parent 0c69328 commit 212a7bb
Copy full SHA for 212a7bb

1 file changed

+3-1Lines changed: 3 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/angular/build/src/builders/unit-test/runners/vitest
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts‎

Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ function determineCoverageProvider(
101101
const hasIstanbul = checkInstalled('@vitest/coverage-istanbul');
102102
const hasV8 = checkInstalled('@vitest/coverage-v8');
103103

104-
if (hasIstanbul && !hasV8) {
104+
// Favor istanbul when browser testing is enabled (to avoid slow CDP V8 HTTP sourcemap remapping)
105+
// or when only istanbul is installed.
106+
if (hasIstanbul && (browsersToCheck.length > 0 || !hasV8)) {
105107
determinedProvider = 'istanbul';
106108
} else {
107109
determinedProvider = 'v8';

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.