Add unit test
This commit is contained in:
parent
29f5291453
commit
236351d4f0
|
@ -259,6 +259,22 @@ namespace ts {
|
||||||
assert.isTrue(!program_1.structureIsReused);
|
assert.isTrue(!program_1.structureIsReused);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("fails if change affects type references", () => {
|
||||||
|
const program_1 = newProgram(files, ["a.ts"], { types: ["a"] });
|
||||||
|
updateProgram(program_1, ["a.ts"], { types: ["b"] }, files => {
|
||||||
|
|
||||||
|
});
|
||||||
|
assert.isTrue(!program_1.structureIsReused);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("succeeds if change doesn't affect type references", () => {
|
||||||
|
const program_1 = newProgram(files, ["a.ts"], { types: ["a"] });
|
||||||
|
updateProgram(program_1, ["a.ts"], { types: ["a"] },afiles => {
|
||||||
|
|
||||||
|
});
|
||||||
|
assert.isTrue(program_1.structureIsReused);
|
||||||
|
});
|
||||||
|
|
||||||
it("fails if change affects imports", () => {
|
it("fails if change affects imports", () => {
|
||||||
const program_1 = newProgram(files, ["a.ts"], { target });
|
const program_1 = newProgram(files, ["a.ts"], { target });
|
||||||
updateProgram(program_1, ["a.ts"], { target }, files => {
|
updateProgram(program_1, ["a.ts"], { target }, files => {
|
||||||
|
|
Loading…
Reference in a new issue