Skip to content

Commit 59ff867

Browse files
alan-agius4dgp1130
authored andcommitted
fix(@angular/build): normalize --include paths to posix
This fixes an issue where relative includes didn't work when using backslashes in windows. Closes #31829 (cherry picked from commit d5b4d03)
1 parent 8f79e6b commit 59ff867

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/angular/build/src/builders/unit-test/test-discovery.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function findTests(
6565
});
6666

6767
for (const match of globMatches) {
68-
resolvedTestFiles.add(match);
68+
resolvedTestFiles.add(toPosixPath(match));
6969
}
7070
}
7171

@@ -261,15 +261,15 @@ async function resolveStaticPattern(
261261
for (const infix of TEST_FILE_INFIXES) {
262262
const potentialSpec = join(dirname(fullPath), `${baseName}${infix}${fileExt}`);
263263
if (await exists(potentialSpec)) {
264-
return { resolved: [potentialSpec], unresolved: [] };
264+
return { resolved: [toPosixPath(potentialSpec)], unresolved: [] };
265265
}
266266
}
267267

268268
if (await exists(fullPath)) {
269-
return { resolved: [fullPath], unresolved: [] };
269+
return { resolved: [toPosixPath(fullPath)], unresolved: [] };
270270
}
271271

272-
return { resolved: [], unresolved: [pattern] };
272+
return { resolved: [], unresolved: [toPosixPath(pattern)] };
273273
}
274274

275275
/** Checks if a path exists and is a directory. */

0 commit comments

Comments
 (0)