File tree Expand file tree Collapse file tree
packages/integration-tests-next/fixtures Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 "cacheDirectory" : " .nxcache" ,
3434 "tui" : {
3535 "autoExit" : true
36+ },
37+ "nxCloudOptions" : {
38+ "detectFlakyTasks" : false
3639 }
3740}
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ import { join } from "node:path";
55const DEBUG = ! ! process . env [ "DEBUG" ] ;
66const CURRENT_SHA = execSync ( "git rev-parse HEAD" , { encoding : "utf-8" } ) . trim ( ) ;
77
8+ type SourceMap = {
9+ sources : string [ ] ;
10+ sourcesContent : string [ ] ;
11+ } ;
12+
813export function runBundler (
914 command : string ,
1015 cwd : string ,
@@ -25,6 +30,16 @@ export function readAllFiles(directory: string): Record<string, string> {
2530 let contents = readFileSync ( fullPath , "utf-8" ) ;
2631 // We replace the current SHA with a placeholder to make snapshots deterministic
2732 contents = contents . replace ( CURRENT_SHA , "CURRENT_SHA" ) ;
33+
34+ if ( entry . endsWith ( ".map" ) ) {
35+ const map = JSON . parse ( contents ) as SourceMap ;
36+ map . sources = map . sources . map ( ( c ) => c . replace ( / \\ / g, "/" ) ) ;
37+ map . sourcesContent = map . sourcesContent . map ( ( c ) => c . replace ( / \r \n / g, "\n" ) ) ;
38+ contents = JSON . stringify ( map ) ;
39+ } else {
40+ // Normalize Windows line endings for cross-platform snapshots
41+ contents = contents . replace ( / \r \n / g, "\n" ) ;
42+ }
2843 files [ entry ] = contents ;
2944 }
3045 }
You can’t perform that action at this time.
0 commit comments