Skip to content

Commit 8070ba5

Browse files
committed
Update tests
1 parent 13e138d commit 8070ba5

File tree

35 files changed

+294
-268
lines changed

35 files changed

+294
-268
lines changed

tests/baselines/reference/duplicatePackage.errors.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/node_modules/b/index.d.ts(1,15): error TS2306: File '/node_modules/b/node_modules/x/index.d.ts' is not a module.
2+
/node_modules/b/node_modules/x/index.d.ts(1,1): error TS1434: Unexpected keyword or identifier.
3+
/node_modules/b/node_modules/x/index.d.ts(1,1): error TS2304: Cannot find name 'content'.
4+
/node_modules/b/node_modules/x/index.d.ts(1,9): error TS1434: Unexpected keyword or identifier.
5+
/node_modules/b/node_modules/x/index.d.ts(1,9): error TS2304: Cannot find name 'not'.
6+
/node_modules/b/node_modules/x/index.d.ts(1,13): error TS2304: Cannot find name 'parsed'.
17
/src/a.ts(5,3): error TS2345: Argument of type 'import("/node_modules/c/node_modules/x/index").default' is not assignable to parameter of type 'import("/node_modules/a/node_modules/x/index").default'.
28
Types have separate declarations of a private property 'x'.
39

@@ -24,12 +30,24 @@
2430
==== /node_modules/a/node_modules/x/package.json (0 errors) ====
2531
{ "name": "x", "version": "1.2.3" }
2632

27-
==== /node_modules/b/index.d.ts (0 errors) ====
33+
==== /node_modules/b/index.d.ts (1 errors) ====
2834
import X from "x";
35+
~~~
36+
!!! error TS2306: File '/node_modules/b/node_modules/x/index.d.ts' is not a module.
2937
export const b: X;
3038

31-
==== /node_modules/b/node_modules/x/index.d.ts (0 errors) ====
39+
==== /node_modules/b/node_modules/x/index.d.ts (5 errors) ====
3240
content not parsed
41+
~~~~~~~
42+
!!! error TS1434: Unexpected keyword or identifier.
43+
~~~~~~~
44+
!!! error TS2304: Cannot find name 'content'.
45+
~~~
46+
!!! error TS1434: Unexpected keyword or identifier.
47+
~~~
48+
!!! error TS2304: Cannot find name 'not'.
49+
~~~~~~
50+
!!! error TS2304: Cannot find name 'parsed'.
3351

3452
==== /node_modules/b/node_modules/x/package.json (0 errors) ====
3553
{ "name": "x", "version": "1.2.3" }

tests/baselines/reference/duplicatePackage.symbols

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ export const b: X;
4444
>X : Symbol(X, Decl(index.d.ts, 0, 6))
4545

4646
=== /node_modules/b/node_modules/x/index.d.ts ===
47-
content not parsed
48-
>X : Symbol(X, Decl(index.d.ts, 0, 0))
4947

50-
>x : Symbol(X.x, Decl(index.d.ts, 0, 24))
48+
content not parsed
5149

5250
=== /node_modules/c/index.d.ts ===
5351
import X from "x";

tests/baselines/reference/duplicatePackage.types

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { a } from "a";
66
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
77

88
import { b } from "b";
9-
>b : import("/node_modules/a/node_modules/x/index").default
10-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
>b : X
10+
> : ^
1111

1212
import { c } from "c";
1313
>c : import("/node_modules/c/node_modules/x/index").default
@@ -18,8 +18,8 @@ a(b); // Works
1818
> : ^^^^
1919
>a : (x: import("/node_modules/a/node_modules/x/index").default) => void
2020
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
21-
>b : import("/node_modules/a/node_modules/x/index").default
22-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
>b : X
22+
> : ^
2323

2424
a(c); // Error, these are from different versions of the library.
2525
>a(c) : void
@@ -52,20 +52,21 @@ export default class X {
5252

5353
=== /node_modules/b/index.d.ts ===
5454
import X from "x";
55-
>X : typeof X
56-
> : ^^^^^^^^
55+
>X : any
56+
> : ^^^
5757

5858
export const b: X;
5959
>b : X
6060
> : ^
6161

6262
=== /node_modules/b/node_modules/x/index.d.ts ===
6363
content not parsed
64-
>X : X
65-
> : ^
66-
67-
>x : number
68-
> : ^^^^^^
64+
>content : any
65+
> : ^^^
66+
>not : any
67+
> : ^^^
68+
>parsed : any
69+
> : ^^^
6970

7071
=== /node_modules/c/index.d.ts ===
7172
import X from "x";

tests/baselines/reference/duplicatePackageServices.baseline.jsonc

Lines changed: 4 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// private x: number;
99
// }|>
1010

11-
// === /node_modules/b/index.d.ts ===
12-
// <|import [|{| defId: 2, isWriteAccess: true |}X|] from "x";|>
13-
// export const b: [|{| defId: 2 |}X|];
14-
1511
// === Definitions ===
1612
// === /node_modules/a/index.d.ts ===
1713
// <|import [|{| defId: 0 |}X|]/*FIND ALL REFS*/ from "x";|>
@@ -22,10 +18,6 @@
2218
// private x: number;
2319
// }|>
2420

25-
// === /node_modules/b/index.d.ts ===
26-
// <|import [|{| defId: 2 |}X|] from "x";|>
27-
// export const b: X;
28-
2921
// === Details ===
3022
[
3123
{
@@ -101,59 +93,6 @@
10193
"kind": "className"
10294
}
10395
]
104-
},
105-
{
106-
"defId": 2,
107-
"containerKind": "",
108-
"containerName": "",
109-
"kind": "alias",
110-
"name": "(alias) class X\nimport X",
111-
"displayParts": [
112-
{
113-
"text": "(",
114-
"kind": "punctuation"
115-
},
116-
{
117-
"text": "alias",
118-
"kind": "text"
119-
},
120-
{
121-
"text": ")",
122-
"kind": "punctuation"
123-
},
124-
{
125-
"text": " ",
126-
"kind": "space"
127-
},
128-
{
129-
"text": "class",
130-
"kind": "keyword"
131-
},
132-
{
133-
"text": " ",
134-
"kind": "space"
135-
},
136-
{
137-
"text": "X",
138-
"kind": "aliasName"
139-
},
140-
{
141-
"text": "\n",
142-
"kind": "lineBreak"
143-
},
144-
{
145-
"text": "import",
146-
"kind": "keyword"
147-
},
148-
{
149-
"text": " ",
150-
"kind": "space"
151-
},
152-
{
153-
"text": "X",
154-
"kind": "aliasName"
155-
}
156-
]
15796
}
15897
]
15998

@@ -169,10 +108,6 @@
169108
// <|import [|{| defId: 1, isWriteAccess: true |}X|] from "x";|>
170109
// export function a(x: [|{| defId: 1 |}X|]): void;
171110

172-
// === /node_modules/b/index.d.ts ===
173-
// <|import [|{| defId: 2, isWriteAccess: true |}X|] from "x";|>
174-
// export const b: [|{| defId: 2 |}X|];
175-
176111
// === Definitions ===
177112
// === /node_modules/a/node_modules/x/index.d.ts ===
178113
// <|export default class /*FIND ALL REFS*/[|{| defId: 0 |}X|] {
@@ -183,10 +118,6 @@
183118
// <|import [|{| defId: 1 |}X|] from "x";|>
184119
// export function a(x: X): void;
185120

186-
// === /node_modules/b/index.d.ts ===
187-
// <|import [|{| defId: 2 |}X|] from "x";|>
188-
// export const b: X;
189-
190121
// === Details ===
191122
[
192123
{
@@ -262,59 +193,6 @@
262193
"kind": "aliasName"
263194
}
264195
]
265-
},
266-
{
267-
"defId": 2,
268-
"containerKind": "",
269-
"containerName": "",
270-
"kind": "alias",
271-
"name": "(alias) class X\nimport X",
272-
"displayParts": [
273-
{
274-
"text": "(",
275-
"kind": "punctuation"
276-
},
277-
{
278-
"text": "alias",
279-
"kind": "text"
280-
},
281-
{
282-
"text": ")",
283-
"kind": "punctuation"
284-
},
285-
{
286-
"text": " ",
287-
"kind": "space"
288-
},
289-
{
290-
"text": "class",
291-
"kind": "keyword"
292-
},
293-
{
294-
"text": " ",
295-
"kind": "space"
296-
},
297-
{
298-
"text": "X",
299-
"kind": "aliasName"
300-
},
301-
{
302-
"text": "\n",
303-
"kind": "lineBreak"
304-
},
305-
{
306-
"text": "import",
307-
"kind": "keyword"
308-
},
309-
{
310-
"text": " ",
311-
"kind": "space"
312-
},
313-
{
314-
"text": "X",
315-
"kind": "aliasName"
316-
}
317-
]
318196
}
319197
]
320198

@@ -325,29 +203,21 @@
325203
// <|import [|{| defId: 0, isWriteAccess: true, isDefinition: true |}X|]/*FIND ALL REFS*/ from "x";|>
326204
// export const b: [|{| defId: 0 |}X|];
327205

328-
// === /node_modules/a/node_modules/x/index.d.ts ===
206+
// === /node_modules/b/node_modules/x/index.d.ts ===
329207
// <|export default class [|{| defId: 1, isWriteAccess: true |}X|] {
330208
// private x: number;
331209
// }|>
332210

333-
// === /node_modules/a/index.d.ts ===
334-
// <|import [|{| defId: 2, isWriteAccess: true |}X|] from "x";|>
335-
// export function a(x: [|{| defId: 2 |}X|]): void;
336-
337211
// === Definitions ===
338212
// === /node_modules/b/index.d.ts ===
339213
// <|import [|{| defId: 0 |}X|]/*FIND ALL REFS*/ from "x";|>
340214
// export const b: X;
341215

342-
// === /node_modules/a/node_modules/x/index.d.ts ===
216+
// === /node_modules/b/node_modules/x/index.d.ts ===
343217
// <|export default class [|{| defId: 1 |}X|] {
344218
// private x: number;
345219
// }|>
346220

347-
// === /node_modules/a/index.d.ts ===
348-
// <|import [|{| defId: 2 |}X|] from "x";|>
349-
// export function a(x: X): void;
350-
351221
// === Details ===
352222
[
353223
{
@@ -423,59 +293,6 @@
423293
"kind": "className"
424294
}
425295
]
426-
},
427-
{
428-
"defId": 2,
429-
"containerKind": "",
430-
"containerName": "",
431-
"kind": "alias",
432-
"name": "(alias) class X\nimport X",
433-
"displayParts": [
434-
{
435-
"text": "(",
436-
"kind": "punctuation"
437-
},
438-
{
439-
"text": "alias",
440-
"kind": "text"
441-
},
442-
{
443-
"text": ")",
444-
"kind": "punctuation"
445-
},
446-
{
447-
"text": " ",
448-
"kind": "space"
449-
},
450-
{
451-
"text": "class",
452-
"kind": "keyword"
453-
},
454-
{
455-
"text": " ",
456-
"kind": "space"
457-
},
458-
{
459-
"text": "X",
460-
"kind": "aliasName"
461-
},
462-
{
463-
"text": "\n",
464-
"kind": "lineBreak"
465-
},
466-
{
467-
"text": "import",
468-
"kind": "keyword"
469-
},
470-
{
471-
"text": " ",
472-
"kind": "space"
473-
},
474-
{
475-
"text": "X",
476-
"kind": "aliasName"
477-
}
478-
]
479296
}
480297
]
481298

@@ -506,7 +323,7 @@
506323

507324

508325
// === goToDefinition ===
509-
// === /node_modules/a/node_modules/x/index.d.ts ===
326+
// === /node_modules/b/node_modules/x/index.d.ts ===
510327
// <|export default class [|X|] {
511328
// private x: number;
512329
// }|>
@@ -520,7 +337,7 @@
520337
{
521338
"kind": "class",
522339
"name": "X",
523-
"containerName": "\"/node_modules/a/node_modules/x/index\"",
340+
"containerName": "\"/node_modules/b/node_modules/x/index\"",
524341
"isLocal": false,
525342
"isAmbient": true,
526343
"unverified": false

tests/baselines/reference/duplicatePackage_globalMerge.symbols

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ export var y = 2
2323

2424
=== /tests/node_modules/@types/react/index.d.ts ===
2525

26-
>global : Symbol(global, Decl(index.d.ts, 0, 0))
27-
2826
=== /node_modules/@types/react/index.d.ts ===
2927
declare global { }
3028
>global : Symbol(global, Decl(index.d.ts, 0, 0))

tests/baselines/reference/duplicatePackage_globalMerge.types

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ export var y = 2
3333

3434
=== /tests/node_modules/@types/react/index.d.ts ===
3535

36-
>global : typeof global
37-
> : ^^^^^^^^^^^^^
38-
3936
=== /node_modules/@types/react/index.d.ts ===
4037
declare global { }
4138
>global : typeof global

0 commit comments

Comments
 (0)