Skip to content

Commit

Permalink
Add test for #30457
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalkamat committed Oct 14, 2019
1 parent 4b10145 commit 758bd99
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/testRunner/unittests/tsc/incremental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace ts {
describe("unittests:: tsc:: incremental::", () => {
verifyTscIncrementalEdits({
scenario: "incremental",
subScenario: "when passing passing filename for buildinfo on commandline",
subScenario: "when passing filename for buildinfo on commandline",
fs: () => loadProjectFromFiles({
"/src/project/src/main.ts": "export const x = 10;",
"/src/project/tsconfig.json": utils.dedent`
Expand All @@ -22,5 +22,21 @@ namespace ts {
modifyFs: noop,
}]
});

verifyTsc({
scenario: "incremental",
subScenario: "when passing rootDir from commandline",
fs: () => loadProjectFromFiles({
"/src/project/src/main.ts": "export const x = 10;",
"/src/project/tsconfig.json": utils.dedent`
{
"compilerOptions": {
"incremental": true,
"outDir": "dist",
},
}`,
}),
commandLineArgs: ["--p", "src/project", "--rootDir", "src/project/src"],
});
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --p src/project --rootDir src/project/src
exitCode:: 0


//// [/src/project/dist/main.js]
"use strict";
exports.__esModule = true;
exports.x = 10;


//// [/src/project/tsconfig.tsbuildinfo]
{
"program": {
"fileInfos": {
"../../lib/lib.d.ts": {
"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; };",
"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; };"
},
"./src/main.ts": {
"version": "-10726455937-export const x = 10;",
"signature": "-6057683066-export declare const x = 10;\r\n"
}
},
"options": {
"incremental": true,
"outDir": "./dist",
"project": "./",
"rootDir": "./src",
"configFilePath": "./tsconfig.json"
},
"referencedMap": {},
"exportedModulesMap": {},
"semanticDiagnosticsPerFile": [
"../../lib/lib.d.ts",
"./src/main.ts"
]
},
"version": "FakeTSVersion"
}

0 comments on commit 758bd99

Please sign in to comment.