File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/angular/build/src/builders/unit-test/runners/vitest Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 99import type { BuilderOutput } from '@angular-devkit/architect' ;
1010import assert from 'node:assert' ;
1111import path from 'node:path' ;
12+ import { coverageConfigDefaults } from 'vitest/config' ;
1213import type { InlineConfig , Vitest } from 'vitest/node' ;
1314import { assertIsError } from '../../../../utils/error' ;
1415import { loadEsmModule } from '../../../../utils/load-esm' ;
@@ -220,7 +221,17 @@ function generateCoverageOption(
220221 excludeAfterRemap : true ,
221222 reportsDirectory : toPosixPath ( path . join ( 'coverage' , projectName ) ) ,
222223 // Special handling for `exclude`/`reporters` due to an undefined value causing upstream failures
223- ...( codeCoverage . exclude ? { exclude : codeCoverage . exclude } : { } ) ,
224+ ...( codeCoverage . exclude
225+ ? {
226+ exclude : [
227+ // Augment the default exclude https://vitest.dev/config/#coverage-exclude
228+ // with the user defined exclusions and the CLI cache directory
229+ '.angular/**' ,
230+ ...codeCoverage . exclude ,
231+ ...coverageConfigDefaults . exclude ,
232+ ] ,
233+ }
234+ : { } ) ,
224235 ...( codeCoverage . reporters
225236 ? ( { reporter : codeCoverage . reporters } satisfies VitestCoverageOption )
226237 : { } ) ,
You can’t perform that action at this time.
0 commit comments