Skip to content

Commit 3fd7dcd

Browse files
committed
fix(@angular/build): normalize roots to POSIX in test discovery for Windows compatibility
Ensures that project and workspace root paths are converted to POSIX format before being used to determine relative test file paths. This fixes an issue on Windows where mixed path separators (backslashes in roots, forward slashes in file paths) caused test discovery to fail to correctly generate entry point names.
1 parent 316fca8 commit 3fd7dcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function generateNameFromPath(
129129
roots: string[],
130130
removeTestExtension: boolean,
131131
): string {
132-
const relativePath = removeRoots(testFile, roots);
132+
const relativePath = removeRoots(testFile, roots.map(toPosixPath));
133133

134134
let startIndex = 0;
135135
// Skip leading dots and slashes

0 commit comments

Comments
 (0)