• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1namespace ts {
2    describe("unittests:: tsc:: projectReferences::", () => {
3        verifyTsc({
4            scenario: "projectReferences",
5            subScenario: "when project contains invalid project reference",
6            fs: () => loadProjectFromFiles({
7                "/src/project/src/main.ts": "export const x = 10;",
8                "/src/project/tsconfig.json": JSON.stringify({
9                    compilerOptions: {
10                        module: "amd",
11                        outFile: "theApp.js"
12                    },
13                    references: [
14                        { path: "../Util/Dates" }
15                    ]
16                }),
17            }),
18            commandLineArgs: ["--p", "src/project"],
19        });
20
21        verifyTsc({
22            scenario: "projectReferences",
23            subScenario: "when project references composite project with noEmit",
24            fs: () => loadProjectFromFiles({
25                "/src/utils/index.ts": "export const x = 10;",
26                "/src/utils/tsconfig.json": JSON.stringify({
27                    compilerOptions: {
28                        composite: true,
29                        noEmit: true,
30                    }
31                }),
32                "/src/project/index.ts": `import { x } from "../utils";`,
33                "/src/project/tsconfig.json": JSON.stringify({
34                    references: [
35                        { path: "../utils" }
36                    ]
37                }),
38            }),
39            commandLineArgs: ["--p", "src/project"]
40        });
41    });
42}
43