Add test with incremental program with only d.ts files

This commit is contained in:
Sheetal Nandi 2019-10-17 11:52:22 -07:00
parent f32c2eac65
commit 5b5f88ead0
4 changed files with 102 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: "with only dts files",
fs: () => loadProjectFromFiles({
"/src/project/src/main.d.ts": "export const x = 10;",
"/src/project/src/another.d.ts": "export const y = 10;",
"/src/project/tsconfig.json": "{}",
}),
commandLineArgs: ["--incremental", "--p", "src/project"],
incrementalScenarios: [
noChangeRun,
{
buildKind: BuildKind.IncrementalDtsUnchanged,
modifyFs: fs => appendText(fs, "/src/project/src/main.d.ts", "export const xy = 100;")
}
]
});
});
}

View file

@ -0,0 +1,41 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --incremental --p src/project
exitCode:: 0
//// [/src/project/src/main.d.ts]
export const x = 10;export const xy = 100;
//// [/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/another.d.ts": {
"version": "-13729955264-export const y = 10;",
"signature": "-13729955264-export const y = 10;"
},
"./src/main.d.ts": {
"version": "-10808461502-export const x = 10;export const xy = 100;",
"signature": "-10808461502-export const x = 10;export const xy = 100;"
}
},
"options": {
"incremental": true,
"project": "./",
"configFilePath": "./tsconfig.json"
},
"referencedMap": {},
"exportedModulesMap": {},
"semanticDiagnosticsPerFile": [
"../../lib/lib.d.ts",
"./src/another.d.ts",
"./src/main.d.ts"
]
},
"version": "FakeTSVersion"
}

View file

@ -0,0 +1,38 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --incremental --p src/project
exitCode:: 0
//// [/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/another.d.ts": {
"version": "-13729955264-export const y = 10;",
"signature": "-13729955264-export const y = 10;"
},
"./src/main.d.ts": {
"version": "-10726455937-export const x = 10;",
"signature": "-10726455937-export const x = 10;"
}
},
"options": {
"incremental": true,
"project": "./",
"configFilePath": "./tsconfig.json"
},
"referencedMap": {},
"exportedModulesMap": {},
"semanticDiagnosticsPerFile": [
"../../lib/lib.d.ts",
"./src/another.d.ts",
"./src/main.d.ts"
]
},
"version": "FakeTSVersion"
}

View file

@ -0,0 +1,5 @@
//// [/lib/no-change-runOutput.txt]
/lib/tsc --incremental --p src/project
exitCode:: 0