Unit test failure; clearHostScreen function

This commit is contained in:
Josh Goldberg 2017-12-04 23:11:01 -08:00
parent a4f83b0835
commit a389ff5f39
2 changed files with 10 additions and 4 deletions

View file

@ -302,9 +302,7 @@ namespace ts {
// There is no extra check needed since we can just rely on the program to decide emit
const builder = createBuilder({ getCanonicalFileName, computeHash });
if (watchingHost.system.clearScreen) {
watchingHost.system.clearScreen();
}
clearHostScreen();
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.Starting_compilation_in_watch_mode));
synchronizeProgram();
@ -496,10 +494,14 @@ namespace ts {
scheduleProgramUpdate();
}
function updateProgram() {
function clearHostScreen() {
if (watchingHost.system.clearScreen) {
watchingHost.system.clearScreen();
}
}
function updateProgram() {
clearHostScreen();
timerToUpdateProgram = undefined;
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation));

View file

@ -117,6 +117,10 @@ namespace ts.tscWatch {
index++;
});
if (!skipWaiting) {
if (errorsPosition === ExpectedOutputErrorsPosition.BeforeCompilationStarts) {
assertWatchDiagnosticAt(host, index, ts.Diagnostics.Starting_compilation_in_watch_mode);
index += 1;
}
assertWatchDiagnosticAt(host, index, Diagnostics.Compilation_complete_Watching_for_file_changes);
}
host.clearOutput();