Skip to content

Commit 140fee9

Browse files
authored
Capture fakes.version instead of the current version string in baselines (microsoft#36518)
* Capture CURRENT.VERSION instead of the current version string in baselines * Use fakes.version * Move replacer into patchHostForBuildInfoReadWrite
1 parent 2fac535 commit 140fee9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/harness/fakesHosts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ ${indentText}${text}`;
534534
buildInfo.version = ts.version;
535535
return ts.getBuildInfoText(buildInfo);
536536
};
537+
const originalWrite = sys.write;
538+
sys.write = msg => originalWrite.call(sys, msg.replace(ts.version, version));
537539

538540
if (sys.writeFile) {
539541
const originalWriteFile = sys.writeFile;

tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//// [/lib/initial-buildOutput.txt]
22
/lib/tsc
3-
Version 3.8.0-dev
3+
Version FakeTSVersion
44
Syntax: tsc [options] [file...]
55

66
Examples: tsc hello.ts

0 commit comments

Comments
 (0)