fix(@angular/build): ensure matching coverage excludes with karma on Windows

When on Windows, the coverage exclusion paths need to be made
absolute via the Node.js path builtin to ensure matching
with the files during the build process.
This commit is contained in:
Charles Lyding 2025-03-03 13:13:17 -05:00 committed by Alan Agius
parent c39c3440cf
commit c8c73185a6

View File

@ -614,7 +614,7 @@ function getInstrumentationExcludedPaths(root: string, excludedPaths: string[]):
for (const excludeGlob of excludedPaths) {
const excludePath = excludeGlob[0] === '/' ? excludeGlob.slice(1) : excludeGlob;
globSync(excludePath, { absolute: true, cwd: root }).forEach((p) => excluded.add(p));
globSync(excludePath, { cwd: root }).forEach((p) => excluded.add(path.join(root, p)));
}
return excluded;