mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 11:54:44 -06:00
Dev: Have a clickable link for a new baseline created (#44552)
* Have a clickable link for a new baseline created * Use joinPath instead:
This commit is contained in:
parent
5a19533d1b
commit
ceef6f7cfd
@ -25,6 +25,7 @@ namespace Harness {
|
||||
tryEnableSourceMapsForHost?(): void;
|
||||
getEnvironmentVariable?(name: string): string;
|
||||
getMemoryUsage?(): number | undefined;
|
||||
joinPath(...components: string[]): string
|
||||
}
|
||||
|
||||
export let IO: IO;
|
||||
@ -62,6 +63,10 @@ namespace Harness {
|
||||
return dirPath === path ? undefined : dirPath;
|
||||
}
|
||||
|
||||
function joinPath(...components: string[]) {
|
||||
return pathModule.join(...components);
|
||||
}
|
||||
|
||||
function enumerateTestFiles(runner: RunnerBase) {
|
||||
return runner.getTestFiles();
|
||||
}
|
||||
@ -156,6 +161,7 @@ namespace Harness {
|
||||
tryEnableSourceMapsForHost: () => ts.sys.tryEnableSourceMapsForHost && ts.sys.tryEnableSourceMapsForHost(),
|
||||
getMemoryUsage: () => ts.sys.getMemoryUsage && ts.sys.getMemoryUsage(),
|
||||
getEnvironmentVariable: name => ts.sys.getEnvironmentVariable(name),
|
||||
joinPath
|
||||
};
|
||||
}
|
||||
|
||||
@ -1388,7 +1394,12 @@ namespace Harness {
|
||||
throw new Error(`The baseline file ${relativeFileName} has changed.${ts.ForegroundColorEscapeSequences.Grey}\n\n${patch}`);
|
||||
}
|
||||
else {
|
||||
throw new Error(`The baseline file ${relativeFileName} has changed.`);
|
||||
if (!IO.fileExists(expected)) {
|
||||
throw new Error(`New baseline created at ${IO.joinPath("tests", "baselines","local", relativeFileName)}`);
|
||||
}
|
||||
else {
|
||||
throw new Error(`The baseline file ${relativeFileName} has changed.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user