• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1namespace ts {
2    describe("unittests:: tsbuild:: on demo project", () => {
3        let projFs: vfs.FileSystem;
4        before(() => {
5            projFs = loadProjectFromDisk("tests/projects/demo");
6        });
7
8        after(() => {
9            projFs = undefined!; // Release the contents
10        });
11
12        verifyTsc({
13            scenario: "demo",
14            subScenario: "in master branch with everything setup correctly and reports no error",
15            fs: () => projFs,
16            commandLineArgs: ["--b", "/src/tsconfig.json", "--verbose"]
17        });
18
19        verifyTsc({
20            scenario: "demo",
21            subScenario: "in circular branch reports the error about it by stopping build",
22            fs: () => projFs,
23            commandLineArgs: ["--b", "/src/tsconfig.json", "--verbose"],
24            modifyFs: fs => replaceText(
25                fs,
26                "/src/core/tsconfig.json",
27                "}",
28                `},
29  "references": [
30    {
31      "path": "../zoo"
32    }
33  ]`
34            )
35        });
36        verifyTsc({
37            scenario: "demo",
38            subScenario: "in bad-ref branch reports the error about files not in rootDir at the import location",
39            fs: () => projFs,
40            commandLineArgs: ["--b", "/src/tsconfig.json", "--verbose"],
41            modifyFs: fs => prependText(
42                fs,
43                "/src/core/utilities.ts",
44                `import * as A from '../animals';
45`
46            )
47        });
48    });
49}
50