Skip to content

Commit e0d8916

Browse files
committed
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: angular#23591
1 parent bf41b66 commit e0d8916

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)