@@ -57,6 +57,7 @@ const { values: rawOptions } = parseArgs({
5757 tests : { type : "string" , short : "t" } ,
5858 fix : { type : "boolean" } ,
5959 debug : { type : "boolean" } ,
60+ dirty : { type : "boolean" } ,
6061
6162 insiders : { type : "boolean" } ,
6263
@@ -325,6 +326,12 @@ function goTest(taskName) {
325326
326327async function runTests ( ) {
327328 warnIfTypeScriptSubmoduleNotCloned ( ) ;
329+
330+ if ( ! options . dirty ) {
331+ await rimraf ( localBaseline ) ;
332+ await fs . promises . mkdir ( localBaseline , { recursive : true } ) ;
333+ }
334+
328335 await $test `${ gotestsum ( "tests" ) } ./... ${ isCI ? [ "--timeout=45m" ] : [ ] } ` ;
329336}
330337
@@ -520,10 +527,13 @@ function baselineAcceptTask(localBaseline, refBaseline) {
520527 } ;
521528}
522529
530+ const localBaseline = "testdata/baselines/local/" ;
531+ const refBaseline = "testdata/baselines/reference/" ;
532+
523533export const baselineAccept = task ( {
524534 name : "baseline-accept" ,
525535 description : "Makes the most recent test results the new baseline, overwriting the old baseline." ,
526- run : baselineAcceptTask ( "testdata/baselines/local/" , "testdata/baselines/reference/" ) ,
536+ run : baselineAcceptTask ( localBaseline , refBaseline ) ,
527537} ) ;
528538
529539/**
0 commit comments