Add test for #34502

This commit is contained in:
Sheetal Nandi 2019-10-16 14:31:59 -07:00
parent 66ea16a23a
commit a4044ca684
3 changed files with 66 additions and 0 deletions

View File

@ -36,5 +36,23 @@ namespace ts {
commandLineArgs: ["--p", "src/project", "--rootDir", "src/project/src"],
incrementalScenarios: [noChangeRun]
});
verifyTscIncrementalEdits({
scenario: "incremental",
subScenario: "when passing rootDir is in the tsconfig",
fs: () => loadProjectFromFiles({
"/src/project/src/main.ts": "export const x = 10;",
"/src/project/tsconfig.json": utils.dedent`
{
"compilerOptions": {
"incremental": true,
"outDir": "./built",
"rootDir": "./"
},
}`,
}),
commandLineArgs: ["--p", "src/project"],
incrementalScenarios: [noChangeRun]
});
});
}

View File

@ -0,0 +1,41 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --p src/project
exitCode:: ExitStatus.Success
//// [/src/project/built/src/main.js]
"use strict";
exports.__esModule = true;
exports.x = 10;
//// [/src/project/built/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": "./",
"rootDir": "..",
"project": "..",
"configFilePath": "../tsconfig.json"
},
"referencedMap": {},
"exportedModulesMap": {},
"semanticDiagnosticsPerFile": [
"../../../lib/lib.d.ts",
"../src/main.ts"
]
},
"version": "FakeTSVersion"
}

View File

@ -0,0 +1,7 @@
//// [/lib/no-change-runOutput.txt]
/lib/tsc --p src/project
exitCode:: ExitStatus.Success
//// [/src/project/built/src/main.js] file written with same contents
//// [/src/project/built/tsconfig.tsbuildinfo] file written with same contents