• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1namespace ts {
2    describe("unittests:: tsbuild - with noEmitOnError", () => {
3        let projFs: vfs.FileSystem;
4        before(() => {
5            projFs = loadProjectFromDisk("tests/projects/noEmitOnError");
6        });
7        after(() => {
8            projFs = undefined!;
9        });
10
11        verifyTscWithEdits({
12            scenario: "noEmitOnError",
13            subScenario: "syntax errors",
14            fs: () => projFs,
15            commandLineArgs: ["--b", "/src/tsconfig.json"],
16            edits: [
17                noChangeRun,
18                {
19                    subScenario: "Fix error",
20                    modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db";
21const a = {
22    lastName: 'sdsd'
23};`, "utf-8"),
24                },
25                noChangeRun,
26            ],
27            baselinePrograms: true,
28        });
29
30        verifyTscWithEdits({
31            scenario: "noEmitOnError",
32            subScenario: "syntax errors with incremental",
33            fs: () => projFs,
34            commandLineArgs: ["--b", "/src/tsconfig.json", "--incremental"],
35            edits: [
36                noChangeRun,
37                {
38                    subScenario: "Fix error",
39                    modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db";
40const a = {
41    lastName: 'sdsd'
42};`, "utf-8"),
43                },
44                noChangeRun,
45            ],
46            baselinePrograms: true,
47        });
48
49        verifyTscWithEdits({
50            scenario: "noEmitOnError",
51            subScenario: "semantic errors",
52            fs: () => projFs,
53            modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db";
54const a: string = 10;`, "utf-8"),
55            commandLineArgs: ["--b", "/src/tsconfig.json"],
56            edits: [
57                noChangeRun,
58                {
59                    subScenario: "Fix error",
60                    modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db";
61const a: string = "hello";`, "utf-8"),
62                },
63                noChangeRun,
64            ],
65            baselinePrograms: true,
66        });
67
68        verifyTscWithEdits({
69            scenario: "noEmitOnError",
70            subScenario: "semantic errors with incremental",
71            fs: () => projFs,
72            modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db";
73const a: string = 10;`, "utf-8"),
74            commandLineArgs: ["--b", "/src/tsconfig.json", "--incremental"],
75            edits: [
76                noChangeWithExportsDiscrepancyRun,
77                {
78                    subScenario: "Fix error",
79                    modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db";
80const a: string = "hello";`, "utf-8"),
81                },
82                noChangeRun,
83            ],
84            baselinePrograms: true,
85        });
86    });
87}
88