Skip to content

Commit d6170f3

Browse files
failing test in pipeline for windows
1 parent 0668496 commit d6170f3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

packages/project-access/test/library/helpers.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,19 @@ describe('validateId', () => {
340340
// Get all files from memFs that match the criteria
341341

342342
const allFiles = (currentStore as any).all().map((file: { path: string }) => file.path);
343+
const normalizedRootPath = rootPath.replace(/\\/g, '/');
343344
return allFiles.filter((filePath: string) => {
345+
const normalizedFilePath = filePath.replace(/\\/g, '/');
344346
// Must be under rootPath
345-
if (!filePath.startsWith(rootPath)) {
347+
if (!normalizedFilePath.startsWith(normalizedRootPath)) {
346348
return false;
347349
}
348350
// Must have the extension
349-
if (!filePath.endsWith(extension)) {
351+
if (!normalizedFilePath.endsWith(extension)) {
350352
return false;
351353
}
352354
// Must not be in excluded folders
353-
const relativePath = filePath.substring(rootPath.length);
355+
const relativePath = normalizedFilePath.substring(normalizedRootPath.length);
354356
return !excludeFolders.some((excluded) => relativePath.includes(`/${excluded}/`));
355357
});
356358
});

0 commit comments

Comments
 (0)