From 0319f103f231cc69a667fc7ec20b298ffd268872 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 12 Sep 2018 15:05:20 -0700 Subject: [PATCH] Test case to verify the non local change doesnt build referencing projects --- src/testRunner/unittests/tsbuildWatchMode.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/testRunner/unittests/tsbuildWatchMode.ts b/src/testRunner/unittests/tsbuildWatchMode.ts index 17e61140b2d..12c82becef3 100644 --- a/src/testRunner/unittests/tsbuildWatchMode.ts +++ b/src/testRunner/unittests/tsbuildWatchMode.ts @@ -187,6 +187,22 @@ export class someClass2 { }`); } }); + it("non local change does not start build of referencing projects", () => { + const host = createSolutionInWatchMode(allFiles); + const outputFileStamps = getOutputFileStamps(host); + host.writeFile(core[1].path, `${core[1].content} +function foo() { }`); + host.checkTimeoutQueueLengthAndRun(1); // Builds core + const changedCore = getOutputFileStamps(host); + verifyChangedFiles(changedCore, outputFileStamps, [ + ...getOutputFileNames(SubProject.core, "anotherModule"), // This should not be written really + ...getOutputFileNames(SubProject.core, "index"), + ]); + host.checkTimeoutQueueLength(0); + checkOutputErrorsIncremental(host, emptyArray); + verifyWatches(host); + }); + it("builds when new file is added, and its subsequent updates", () => { const additinalFiles: ReadonlyArray<[SubProject, string]> = [[SubProject.core, newFileWithoutExtension]]; const { verifyChangeWithFile } = createSolutionInWatchModeToVerifyChanges(additinalFiles);