Skip to content

Commit ded0933

Browse files
committed
Update tests
1 parent 7ec84ce commit ded0933

28 files changed

+162
-71
lines changed

src/testRunner/unittests/helpers/libraryResolution.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ function getSysForLibResolution(libRedirection?: boolean, forTsserver?: boolean)
2121
/// <reference lib="es5"/>
2222
`,
2323
"/home/src/workspace/projects/project1/tsconfig.json": jsonToReadableText({
24-
compilerOptions: { composite: true, typeRoots: ["./typeroot1"], lib: ["es5", "dom"], traceResolution: true },
24+
compilerOptions: { composite: true, typeRoots: ["./typeroot1"], lib: ["es5", "dom"], traceResolution: true, libReplacement: libRedirection },
2525
}),
2626
"/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts": `export type TheNum = "type1";`,
2727
"/home/src/workspace/projects/project2/utils.d.ts": `export const y = 10;`,
2828
"/home/src/workspace/projects/project2/index.ts": `export const y = 10`,
2929
"/home/src/workspace/projects/project2/tsconfig.json": jsonToReadableText({
30-
compilerOptions: { composite: true, lib: ["es5", "dom"], traceResolution: true },
30+
compilerOptions: { composite: true, lib: ["es5", "dom"], traceResolution: true, libReplacement: libRedirection },
3131
}),
3232
"/home/src/workspace/projects/project3/utils.d.ts": `export const y = 10;`,
3333
"/home/src/workspace/projects/project3/index.ts": `export const z = 10`,
3434
"/home/src/workspace/projects/project3/tsconfig.json": jsonToReadableText({
35-
compilerOptions: { composite: true, lib: ["es5", "dom"], traceResolution: true },
35+
compilerOptions: { composite: true, lib: ["es5", "dom"], traceResolution: true, libReplacement: libRedirection },
3636
}),
3737
"/home/src/workspace/projects/project4/utils.d.ts": `export const y = 10;`,
3838
"/home/src/workspace/projects/project4/index.ts": `export const z = 10`,
3939
"/home/src/workspace/projects/project4/tsconfig.json": jsonToReadableText({
40-
compilerOptions: { composite: true, lib: ["esnext", "dom", "webworker"], traceResolution: true },
40+
compilerOptions: { composite: true, lib: ["esnext", "dom", "webworker"], traceResolution: true, libReplacement: libRedirection },
4141
}),
4242
[getTypeScriptLibTestLocation("dom")]: "interface DOMInterface { }",
4343
[getTypeScriptLibTestLocation("webworker")]: "interface WebWorkerInterface { }",
@@ -71,6 +71,7 @@ function getLibResolutionEditOptions(
7171
typeRoots: ["./typeroot1", "./typeroot2"],
7272
lib: ["es5", "dom"],
7373
traceResolution: true,
74+
libReplacement: true,
7475
},
7576
}),
7677
),
@@ -90,6 +91,7 @@ function getLibResolutionEditOptions(
9091
typeRoots: ["./typeroot1"],
9192
lib: ["es5", "dom"],
9293
traceResolution: true,
94+
libReplacement: true,
9395
},
9496
}),
9597
);
@@ -235,6 +237,7 @@ export function getSysForLibResolutionUnknown(): TestServerHost {
235237
compilerOptions: {
236238
composite: true,
237239
traceResolution: true,
240+
libReplacement: true,
238241
},
239242
}),
240243
[getTypeScriptLibTestLocation("webworker")]: "interface WebWorkerInterface { }",

tests/baselines/reference/libTypeScriptOverrideSimple.errors.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ index.ts(6,1): error TS2304: Cannot find name 'window'.
1111
// by the module above ^
1212
window.localStorage
1313
~~~~~~
14-
!!! error TS2304: Cannot find name 'window'.
14+
!!! error TS2304: Cannot find name 'window'.
15+

tests/baselines/reference/libTypeScriptOverrideSimple.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const a: ABC = { abc: "Hello" }
88

99
// This should fail because libdom has been replaced
1010
// by the module above ^
11-
window.localStorage
11+
window.localStorage
12+
1213

1314
//// [index.js]
1415
/// <reference lib="dom" />

tests/baselines/reference/libTypeScriptOverrideSimple.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ const a: ABC = { abc: "Hello" }
1515
// This should fail because libdom has been replaced
1616
// by the module above ^
1717
window.localStorage
18+

tests/baselines/reference/libTypeScriptOverrideSimpleConfig.errors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
window.localStorage
1313
~~~~~~
1414
!!! error TS2304: Cannot find name 'window'.
15+
1516
==== /somepath/node_modules/@typescript/lib-dom/index.d.ts (0 errors) ====
1617
interface ABC { abc: string }

tests/baselines/reference/libTypeScriptOverrideSimpleConfig.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const a: ABC = { abc: "Hello" }
88

99
// This should fail because libdom has been replaced
1010
// by the module above ^
11-
window.localStorage
11+
window.localStorage
12+
1213

1314
//// [index.js]
1415
/// <reference lib="dom" />

tests/baselines/reference/libTypeScriptOverrideSimpleConfig.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const a: ABC = { abc: "Hello" }
1010
// This should fail because libdom has been replaced
1111
// by the module above ^
1212
window.localStorage
13+
1314
=== /somepath/node_modules/@typescript/lib-dom/index.d.ts ===
1415
interface ABC { abc: string }
1516
>ABC : Symbol(ABC, Decl(index.d.ts, 0, 0))

tests/baselines/reference/libTypeScriptSubfileResolving.errors.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ index.ts(6,1): error TS2304: Cannot find name 'window'.
1313
// by the module above ^
1414
window.localStorage
1515
~~~~~~
16-
!!! error TS2304: Cannot find name 'window'.
16+
!!! error TS2304: Cannot find name 'window'.
17+

tests/baselines/reference/libTypeScriptSubfileResolving.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const a: DOMIterable = { abc: "Hello" }
1010

1111
// This should fail because libdom has been replaced
1212
// by the module above ^
13-
window.localStorage
13+
window.localStorage
14+
1415

1516
//// [index.js]
1617
/// <reference lib="dom.iterable" />

tests/baselines/reference/libTypeScriptSubfileResolving.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ const a: DOMIterable = { abc: "Hello" }
1818
// This should fail because libdom has been replaced
1919
// by the module above ^
2020
window.localStorage
21+

0 commit comments

Comments
 (0)