• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1namespace ts.tscWatch {
2    describe("unittests:: tsbuildWatch:: watchMode:: with noEmit", () => {
3        verifyTscWatch({
4            scenario: "noEmit",
5            subScenario: "does not go in loop when watching when no files are emitted",
6            commandLineArgs: ["-b", "-w", "-verbose"],
7            sys: () => createWatchedSystem(
8                [
9                    { path: libFile.path, content: libContent },
10                    { path: `${projectRoot}/a.js`, content: "" },
11                    { path: `${projectRoot}/b.ts`, content: "" },
12                    { path: `${projectRoot}/tsconfig.json`, content: JSON.stringify({ compilerOptions: { allowJs: true, noEmit: true } }) },
13                ],
14                { currentDirectory: projectRoot }
15            ),
16            changes: [
17                {
18                    caption: "No change",
19                    change: sys => sys.writeFile(`${projectRoot}/a.js`, sys.readFile(`${projectRoot}/a.js`)!),
20                    // build project
21                    timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout,
22                },
23                {
24                    caption: "change",
25                    change: sys => sys.writeFile(`${projectRoot}/a.js`, "const x = 10;"),
26                    // build project
27                    timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout,
28                },
29            ],
30            baselineIncremental: true
31        });
32    });
33}