Skip to content

Commit 758bd99

Browse files
committed
Add test for #30457
1 parent 4b10145 commit 758bd99

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

src/testRunner/unittests/tsc/incremental.ts

+17-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace ts {
22
describe("unittests:: tsc:: incremental::", () => {
33
verifyTscIncrementalEdits({
44
scenario: "incremental",
5-
subScenario: "when passing passing filename for buildinfo on commandline",
5+
subScenario: "when passing filename for buildinfo on commandline",
66
fs: () => loadProjectFromFiles({
77
"/src/project/src/main.ts": "export const x = 10;",
88
"/src/project/tsconfig.json": utils.dedent`
@@ -22,5 +22,21 @@ namespace ts {
2222
modifyFs: noop,
2323
}]
2424
});
25+
26+
verifyTsc({
27+
scenario: "incremental",
28+
subScenario: "when passing rootDir from commandline",
29+
fs: () => loadProjectFromFiles({
30+
"/src/project/src/main.ts": "export const x = 10;",
31+
"/src/project/tsconfig.json": utils.dedent`
32+
{
33+
"compilerOptions": {
34+
"incremental": true,
35+
"outDir": "dist",
36+
},
37+
}`,
38+
}),
39+
commandLineArgs: ["--p", "src/project", "--rootDir", "src/project/src"],
40+
});
2541
});
2642
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//// [/lib/initial-buildOutput.txt]
2+
/lib/tsc --p src/project --rootDir src/project/src
3+
exitCode:: 0
4+
5+
6+
//// [/src/project/dist/main.js]
7+
"use strict";
8+
exports.__esModule = true;
9+
exports.x = 10;
10+
11+
12+
//// [/src/project/tsconfig.tsbuildinfo]
13+
{
14+
"program": {
15+
"fileInfos": {
16+
"../../lib/lib.d.ts": {
17+
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
18+
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
19+
},
20+
"./src/main.ts": {
21+
"version": "-10726455937-export const x = 10;",
22+
"signature": "-6057683066-export declare const x = 10;\r\n"
23+
}
24+
},
25+
"options": {
26+
"incremental": true,
27+
"outDir": "./dist",
28+
"project": "./",
29+
"rootDir": "./src",
30+
"configFilePath": "./tsconfig.json"
31+
},
32+
"referencedMap": {},
33+
"exportedModulesMap": {},
34+
"semanticDiagnosticsPerFile": [
35+
"../../lib/lib.d.ts",
36+
"./src/main.ts"
37+
]
38+
},
39+
"version": "FakeTSVersion"
40+
}
41+

0 commit comments

Comments
 (0)