File tree Expand file tree Collapse file tree
packages/project-access/test/library Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments