Skip to content

Commit 5810c2c

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): fallback to use projectRoot when sourceRoot is missing during coverage
With this change we fallback to use the projectRoot when the sourceRoot is missing for files to be included in coverage. Closes: #23591 (cherry picked from commit d8cfe8b)
1 parent c2201c8 commit 5810c2c

File tree

1 file changed

+1
-1
lines changed
  • packages/angular_devkit/build_angular/src/webpack/configs

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/webpack/configs/common.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config
386386
supportedBrowsers: buildOptions.supportedBrowsers,
387387
instrumentCode: codeCoverage
388388
? {
389-
includedBasePath: sourceRoot,
389+
includedBasePath: sourceRoot ?? projectRoot,
390390
excludedPaths: getInstrumentationExcludedPaths(root, codeCoverageExclude),
391391
}
392392
: undefined,

0 commit comments

Comments
 (0)