@@ -25,6 +25,7 @@ namespace Harness {
25
25
tryEnableSourceMapsForHost ?( ) : void ;
26
26
getEnvironmentVariable ?( name : string ) : string ;
27
27
getMemoryUsage ?( ) : number | undefined ;
28
+ joinPath ( ...components : string [ ] ) : string
28
29
}
29
30
30
31
export let IO : IO ;
@@ -62,6 +63,10 @@ namespace Harness {
62
63
return dirPath === path ? undefined : dirPath ;
63
64
}
64
65
66
+ function joinPath ( ...components : string [ ] ) {
67
+ return pathModule . join ( ...components ) ;
68
+ }
69
+
65
70
function enumerateTestFiles ( runner : RunnerBase ) {
66
71
return runner . getTestFiles ( ) ;
67
72
}
@@ -156,6 +161,7 @@ namespace Harness {
156
161
tryEnableSourceMapsForHost : ( ) => ts . sys . tryEnableSourceMapsForHost && ts . sys . tryEnableSourceMapsForHost ( ) ,
157
162
getMemoryUsage : ( ) => ts . sys . getMemoryUsage && ts . sys . getMemoryUsage ( ) ,
158
163
getEnvironmentVariable : name => ts . sys . getEnvironmentVariable ( name ) ,
164
+ joinPath
159
165
} ;
160
166
}
161
167
@@ -1388,7 +1394,12 @@ namespace Harness {
1388
1394
throw new Error ( `The baseline file ${ relativeFileName } has changed.${ ts . ForegroundColorEscapeSequences . Grey } \n\n${ patch } ` ) ;
1389
1395
}
1390
1396
else {
1391
- throw new Error ( `The baseline file ${ relativeFileName } has changed.` ) ;
1397
+ if ( ! IO . fileExists ( expected ) ) {
1398
+ throw new Error ( `New baseline created at ${ IO . joinPath ( "tests" , "baselines" , "local" , relativeFileName ) } ` ) ;
1399
+ }
1400
+ else {
1401
+ throw new Error ( `The baseline file ${ relativeFileName } has changed.` ) ;
1402
+ }
1392
1403
}
1393
1404
}
1394
1405
}
0 commit comments