Skip to content

Commit a4044ca

Browse files
committed
Add test for microsoft#34502
1 parent 66ea16a commit a4044ca

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

src/testRunner/unittests/tsc/incremental.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,23 @@ namespace ts {
3636
commandLineArgs: ["--p", "src/project", "--rootDir", "src/project/src"],
3737
incrementalScenarios: [noChangeRun]
3838
});
39+
40+
verifyTscIncrementalEdits({
41+
scenario: "incremental",
42+
subScenario: "when passing rootDir is in the tsconfig",
43+
fs: () => loadProjectFromFiles({
44+
"/src/project/src/main.ts": "export const x = 10;",
45+
"/src/project/tsconfig.json": utils.dedent`
46+
{
47+
"compilerOptions": {
48+
"incremental": true,
49+
"outDir": "./built",
50+
"rootDir": "./"
51+
},
52+
}`,
53+
}),
54+
commandLineArgs: ["--p", "src/project"],
55+
incrementalScenarios: [noChangeRun]
56+
});
3957
});
4058
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//// [/lib/initial-buildOutput.txt]
2+
/lib/tsc --p src/project
3+
exitCode:: ExitStatus.Success
4+
5+
6+
//// [/src/project/built/src/main.js]
7+
"use strict";
8+
exports.__esModule = true;
9+
exports.x = 10;
10+
11+
12+
//// [/src/project/built/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": "./",
28+
"rootDir": "..",
29+
"project": "..",
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+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//// [/lib/no-change-runOutput.txt]
2+
/lib/tsc --p src/project
3+
exitCode:: ExitStatus.Success
4+
5+
6+
//// [/src/project/built/src/main.js] file written with same contents
7+
//// [/src/project/built/tsconfig.tsbuildinfo] file written with same contents

0 commit comments

Comments
 (0)