Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30971 from Microsoft/dtsSignatureChange
Handle when change in type of dts may result in only dts emit but not js emit
- Loading branch information
Showing
12 changed files
with
410 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
namespace ts { | ||
describe("unittests:: tsbuild:: inferredTypeFromTransitiveModule::", () => { | ||
let projFs: vfs.FileSystem; | ||
const { time, tick } = getTime(); | ||
before(() => { | ||
projFs = loadProjectFromDisk("tests/projects/inferredTypeFromTransitiveModule", time); | ||
}); | ||
after(() => { | ||
projFs = undefined!; | ||
}); | ||
|
||
verifyTsbuildOutput({ | ||
scenario: "inferred type from transitive module", | ||
projFs: () => projFs, | ||
time, | ||
tick, | ||
proj: "inferredTypeFromTransitiveModule", | ||
rootNames: ["/src"], | ||
expectedMapFileNames: emptyArray, | ||
lastProjectOutputJs: `/src/obj/index.js`, | ||
outputFiles: [ | ||
"/src/obj/bar.js", "/src/obj/bar.d.ts", | ||
"/src/obj/bundling.js", "/src/obj/bundling.d.ts", | ||
"/src/obj/lazyIndex.js", "/src/obj/lazyIndex.d.ts", | ||
"/src/obj/index.js", "/src/obj/index.d.ts", | ||
"/src/obj/tsconfig.tsbuildinfo" | ||
], | ||
initialBuild: { | ||
modifyFs: noop, | ||
expectedDiagnostics: [ | ||
getExpectedDiagnosticForProjectsInBuild("src/tsconfig.json"), | ||
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/tsconfig.json", "src/obj/bar.js"], | ||
[Diagnostics.Building_project_0, "/src/tsconfig.json"] | ||
] | ||
}, | ||
incrementalDtsChangedBuild: { | ||
modifyFs: fs => replaceText(fs, "/src/bar.ts", "param: string", ""), | ||
expectedDiagnostics: [ | ||
getExpectedDiagnosticForProjectsInBuild("src/tsconfig.json"), | ||
[Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, "src/tsconfig.json", "src/obj/bar.js", "src/bar.ts"], | ||
[Diagnostics.Building_project_0, "/src/tsconfig.json"], | ||
[Diagnostics.Updating_unchanged_output_timestamps_of_project_0, "/src/tsconfig.json"] | ||
] | ||
}, | ||
baselineOnly: true, | ||
verifyDiagnostics: true | ||
}); | ||
}); | ||
} |
Oops, something went wrong.