• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1namespace ts {
2    describe("unittests:: tsbuild:: when containerOnly project is referenced", () => {
3        verifyTscWithEdits({
4            scenario: "containerOnlyReferenced",
5            subScenario: "verify that subsequent builds after initial build doesnt build anything",
6            fs: () => loadProjectFromDisk("tests/projects/containerOnlyReferenced"),
7            commandLineArgs: ["--b", "/src", "--verbose"],
8            edits: noChangeOnlyRuns
9        });
10
11        verifyTscWithEdits({
12            scenario: "containerOnlyReferenced",
13            subScenario: "when solution is referenced indirectly",
14            fs: () => loadProjectFromFiles({
15                "/src/project1/tsconfig.json": JSON.stringify({
16                    compilerOptions: { composite: true },
17                    references: [],
18                }),
19                "/src/project2/tsconfig.json": JSON.stringify({
20                    compilerOptions: { composite: true },
21                    references: [],
22                }),
23                "/src/project2/src/b.ts": "export const b = 10;",
24                "/src/project3/tsconfig.json": JSON.stringify({
25                    compilerOptions: { composite: true },
26                    references: [{ path: "../project1", }, { path: "../project2" }],
27                }),
28                "/src/project3/src/c.ts": "export const c = 10;",
29                "/src/project4/tsconfig.json": JSON.stringify({
30                    compilerOptions: { composite: true },
31                    references: [{ path: "../project3" }]
32                }),
33                "/src/project4/src/d.ts": "export const d = 10;",
34            }),
35            commandLineArgs: ["--b", "/src/project4", "--verbose", "--explainFiles"],
36            edits: [{
37                subScenario: "modify project3 file",
38                modifyFs: fs => replaceText(fs, "/src/project3/src/c.ts", "c = ", "cc = "),
39            }],
40        });
41    });
42}
43