Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ceef6f7

Browse filesBrowse files
author
Orta Therox
authored
Dev: Have a clickable link for a new baseline created (microsoft#44552)
* Have a clickable link for a new baseline created * Use joinPath instead:
1 parent 5a19533 commit ceef6f7
Copy full SHA for ceef6f7

1 file changed

+12-1Lines changed: 12 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/harness/harnessIO.ts‎

Copy file name to clipboardExpand all lines: src/harness/harnessIO.ts
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace Harness {
2525
tryEnableSourceMapsForHost?(): void;
2626
getEnvironmentVariable?(name: string): string;
2727
getMemoryUsage?(): number | undefined;
28+
joinPath(...components: string[]): string
2829
}
2930

3031
export let IO: IO;
@@ -62,6 +63,10 @@ namespace Harness {
6263
return dirPath === path ? undefined : dirPath;
6364
}
6465

66+
function joinPath(...components: string[]) {
67+
return pathModule.join(...components);
68+
}
69+
6570
function enumerateTestFiles(runner: RunnerBase) {
6671
return runner.getTestFiles();
6772
}
@@ -156,6 +161,7 @@ namespace Harness {
156161
tryEnableSourceMapsForHost: () => ts.sys.tryEnableSourceMapsForHost && ts.sys.tryEnableSourceMapsForHost(),
157162
getMemoryUsage: () => ts.sys.getMemoryUsage && ts.sys.getMemoryUsage(),
158163
getEnvironmentVariable: name => ts.sys.getEnvironmentVariable(name),
164+
joinPath
159165
};
160166
}
161167

@@ -1388,7 +1394,12 @@ namespace Harness {
13881394
throw new Error(`The baseline file ${relativeFileName} has changed.${ts.ForegroundColorEscapeSequences.Grey}\n\n${patch}`);
13891395
}
13901396
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+
}
13921403
}
13931404
}
13941405
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.