From c974b2ced7b284557577b5a8a477f3376723cd70 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 17 Apr 2018 08:57:05 -0700 Subject: [PATCH] Helps to check in the test changes, too --- src/compiler/watch.ts | 2 +- src/harness/unittests/tscWatchMode.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index f125fab5a5e..330aeaaa840 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -45,7 +45,7 @@ namespace ts { } /** @internal */ - const screenStartingMessageCodes: number[] = [ + export const screenStartingMessageCodes: number[] = [ Diagnostics.Starting_compilation_in_watch_mode.code, Diagnostics.File_change_detected_Starting_incremental_compilation.code, ]; diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 99bad3e3091..d57a8e9b6d0 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -124,7 +124,10 @@ namespace ts.tscWatch { } function getWatchDiagnosticWithoutDate(diagnostic: Diagnostic) { - return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${host.newLine + host.newLine + host.newLine}`; + const newLines = contains(screenStartingMessageCodes, diagnostic.code) + ? `${host.newLine}${host.newLine}` + : host.newLine; + return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${newLines}`; } }