From 140fee96d70a6bd4e3acba9d60299c01976609e3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 29 Jan 2020 16:15:09 -0800 Subject: [PATCH] Capture fakes.version instead of the current version string in baselines (#36518) * Capture CURRENT.VERSION instead of the current version string in baselines * Use fakes.version * Move replacer into patchHostForBuildInfoReadWrite --- src/harness/fakesHosts.ts | 2 ++ ...ow-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/harness/fakesHosts.ts b/src/harness/fakesHosts.ts index 0f0cfaab994..58e9ec783e5 100644 --- a/src/harness/fakesHosts.ts +++ b/src/harness/fakesHosts.ts @@ -534,6 +534,8 @@ ${indentText}${text}`; buildInfo.version = ts.version; return ts.getBuildInfoText(buildInfo); }; + const originalWrite = sys.write; + sys.write = msg => originalWrite.call(sys, msg.replace(ts.version, version)); if (sys.writeFile) { const originalWriteFile = sys.writeFile; diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index ce4332cb01a..8243fd3958f 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -1,6 +1,6 @@ //// [/lib/initial-buildOutput.txt] /lib/tsc -Version 3.8.0-dev +Version FakeTSVersion Syntax: tsc [options] [file...] Examples: tsc hello.ts