• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1namespace ts {
2    describe("unittests:: tsc:: composite::", () => {
3        verifyTsc({
4            scenario: "composite",
5            subScenario: "when setting composite false on command line",
6            fs: () => loadProjectFromFiles({
7                "/src/project/src/main.ts": "export const x = 10;",
8                "/src/project/tsconfig.json": Utils.dedent`
9                    {
10                        "compilerOptions": {
11                            "target": "es5",
12                            "module": "commonjs",
13                            "composite": true,
14                        },
15                        "include": [
16                            "src/**/*.ts"
17                        ]
18                    }`,
19            }),
20            commandLineArgs: ["--composite", "false", "--p", "src/project"],
21        });
22
23        verifyTsc({
24            scenario: "composite",
25            subScenario: "when setting composite null on command line",
26            fs: () => loadProjectFromFiles({
27                "/src/project/src/main.ts": "export const x = 10;",
28                "/src/project/tsconfig.json": Utils.dedent`
29                    {
30                        "compilerOptions": {
31                            "target": "es5",
32                            "module": "commonjs",
33                            "composite": true,
34                        },
35                        "include": [
36                            "src/**/*.ts"
37                        ]
38                    }`,
39            }),
40            commandLineArgs: ["--composite", "null", "--p", "src/project"],
41        });
42
43        verifyTsc({
44            scenario: "composite",
45            subScenario: "when setting composite false on command line but has tsbuild info in config",
46            fs: () => loadProjectFromFiles({
47                "/src/project/src/main.ts": "export const x = 10;",
48                "/src/project/tsconfig.json": Utils.dedent`
49                    {
50                        "compilerOptions": {
51                            "target": "es5",
52                            "module": "commonjs",
53                            "composite": true,
54                            "tsBuildInfoFile": "tsconfig.json.tsbuildinfo"
55                        },
56                        "include": [
57                            "src/**/*.ts"
58                        ]
59                    }`,
60            }),
61            commandLineArgs: ["--composite", "false", "--p", "src/project"],
62        });
63
64        verifyTsc({
65            scenario: "composite",
66            subScenario: "when setting composite false and tsbuildinfo as null on command line but has tsbuild info in config",
67            fs: () => loadProjectFromFiles({
68                "/src/project/src/main.ts": "export const x = 10;",
69                "/src/project/tsconfig.json": Utils.dedent`
70                    {
71                        "compilerOptions": {
72                            "target": "es5",
73                            "module": "commonjs",
74                            "composite": true,
75                            "tsBuildInfoFile": "tsconfig.json.tsbuildinfo"
76                        },
77                        "include": [
78                            "src/**/*.ts"
79                        ]
80                    }`,
81            }),
82            commandLineArgs: ["--composite", "false", "--p", "src/project", "--tsBuildInfoFile", "null"],
83        });
84    });
85}
86