Skip to content

Commit 868fb7c

Browse files
committed
Add types: * to auto-import unit test
1 parent 787f9b6 commit 868fb7c

12 files changed

Lines changed: 93 additions & 159 deletions

src/testRunner/unittests/tsserver/autoImportProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const angularCorePackageJson: File = {
2929
};
3030
const tsconfig: File = {
3131
path: "/user/username/projects/project/tsconfig.json",
32-
content: `{ "compilerOptions": { "module": "commonjs" } }`,
32+
content: `{ "compilerOptions": { "module": "commonjs", "types": ["*"] } }`,
3333
};
3434
const packageJson: File = {
3535
path: "/user/username/projects/project/package.json",

tests/baselines/reference/tsserver/autoImportProvider/Auto-importable-file-is-in-inferred-project-until-imported.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export declare class PatternValidator {}
1010
{ "name": "@angular/forms", "typings": "./forms.d.ts" }
1111

1212
//// [/user/username/projects/project/tsconfig.json]
13-
{ "compilerOptions": { "module": "commonjs" } }
13+
{ "compilerOptions": { "module": "commonjs", "types": ["*"] } }
1414

1515
//// [/user/username/projects/project/package.json]
1616
{ "dependencies": { "@angular/forms": "*", "@angular/core": "*" } }
@@ -294,6 +294,9 @@ Info seq [hh:mm:ss:mss] Config: /user/username/projects/project/tsconfig.json :
294294
],
295295
"options": {
296296
"module": 1,
297+
"types": [
298+
"*"
299+
],
297300
"configFilePath": "/user/username/projects/project/tsconfig.json"
298301
}
299302
}
@@ -314,10 +317,6 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/pr
314317
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations
315318
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/project/package.json 2000 undefined Project: /user/username/projects/project/tsconfig.json WatchType: File location affecting resolution
316319
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@angular/forms/package.json 2000 undefined Project: /user/username/projects/project/tsconfig.json WatchType: File location affecting resolution
317-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
318-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
319-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
320-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
321320
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
322321
Info seq [hh:mm:ss:mss] Project '/user/username/projects/project/tsconfig.json' (Configured)
323322
Info seq [hh:mm:ss:mss] Files (3)
@@ -368,7 +367,10 @@ Info seq [hh:mm:ss:mss] event:
368367
"deferredSize": 0
369368
},
370369
"compilerOptions": {
371-
"module": "commonjs"
370+
"module": "commonjs",
371+
"types": [
372+
""
373+
]
372374
},
373375
"typeAcquisition": {
374376
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Closes-AutoImportProviderProject-when-host-project-closes.js

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export declare class PatternValidator {}
1010
{ "name": "@angular/forms", "typings": "./forms.d.ts" }
1111

1212
//// [/user/username/projects/project/tsconfig.json]
13-
{ "compilerOptions": { "module": "commonjs" } }
13+
{ "compilerOptions": { "module": "commonjs", "types": ["*"] } }
1414

1515
//// [/user/username/projects/project/package.json]
1616
{ "dependencies": { "@angular/forms": "*", "@angular/core": "*" } }
@@ -75,6 +75,9 @@ Info seq [hh:mm:ss:mss] Config: /user/username/projects/project/tsconfig.json :
7575
],
7676
"options": {
7777
"module": 1,
78+
"types": [
79+
"*"
80+
],
7881
"configFilePath": "/user/username/projects/project/tsconfig.json"
7982
}
8083
}
@@ -92,10 +95,6 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/pr
9295
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project 1 undefined Config: /user/username/projects/project/tsconfig.json WatchType: Wild card directory
9396
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/project/tsconfig.json
9497
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
95-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
96-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
97-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
98-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
9998
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
10099
Info seq [hh:mm:ss:mss] Project '/user/username/projects/project/tsconfig.json' (Configured)
101100
Info seq [hh:mm:ss:mss] Files (2)
@@ -159,7 +158,10 @@ Info seq [hh:mm:ss:mss] event:
159158
"deferredSize": 0
160159
},
161160
"compilerOptions": {
162-
"module": "commonjs"
161+
"module": "commonjs",
162+
"types": [
163+
""
164+
]
163165
},
164166
"typeAcquisition": {
165167
"enable": false,
@@ -214,12 +216,6 @@ Info seq [hh:mm:ss:mss] response:
214216
}
215217
After request
216218
217-
PolledWatches::
218-
/user/username/projects/node_modules/@types: *new*
219-
{"pollingInterval":500}
220-
/user/username/projects/project/node_modules/@types: *new*
221-
{"pollingInterval":500}
222-
223219
FsWatches::
224220
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
225221
{}
@@ -292,12 +288,6 @@ Info seq [hh:mm:ss:mss] response:
292288
}
293289
After request
294290
295-
PolledWatches::
296-
/user/username/projects/node_modules/@types:
297-
{"pollingInterval":500}
298-
/user/username/projects/project/node_modules/@types:
299-
{"pollingInterval":500}
300-
301291
FsWatches::
302292
/home/src/tslibs/TS/Lib/lib.d.ts:
303293
{}
@@ -415,10 +405,6 @@ Info seq [hh:mm:ss:mss] -----------------------------------------------
415405
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/project 1 undefined Config: /user/username/projects/project/tsconfig.json WatchType: Wild card directory
416406
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/project 1 undefined Config: /user/username/projects/project/tsconfig.json WatchType: Wild card directory
417407
Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /user/username/projects/project/tsconfig.json 2000 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Config file
418-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
419-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
420-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
421-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
422408
Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /user/username/projects/project/node_modules/@angular/forms/package.json 2000 undefined Project: /dev/null/autoImportProviderProject1* WatchType: File location affecting resolution
423409
Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /user/username/projects/project/index.ts 500 undefined WatchType: Closed Script info
424410
Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred)
@@ -447,9 +433,9 @@ Info seq [hh:mm:ss:mss] response:
447433
After request
448434

449435
PolledWatches::
450-
/user/username/projects/node_modules/@types:
436+
/user/username/projects/node_modules/@types: *new*
451437
{"pollingInterval":500}
452-
/user/username/projects/project/node_modules/@types:
438+
/user/username/projects/project/node_modules/@types: *new*
453439
{"pollingInterval":500}
454440
/user/username/projects/project/random/jsconfig.json: *new*
455441
{"pollingInterval":2000}

tests/baselines/reference/tsserver/autoImportProvider/Does-not-create-an-auto-import-provider-if-there-are-too-many-dependencies.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Before request
6767

6868

6969
//// [/user/username/projects/project/tsconfig.json]
70-
{ "compilerOptions": { "module": "commonjs" } }
70+
{ "compilerOptions": { "module": "commonjs", "types": ["*"] } }
7171

7272
//// [/user/username/projects/project/package.json]
7373
{
@@ -140,6 +140,9 @@ Info seq [hh:mm:ss:mss] Config: /user/username/projects/project/tsconfig.json :
140140
],
141141
"options": {
142142
"module": 1,
143+
"types": [
144+
"*"
145+
],
143146
"configFilePath": "/user/username/projects/project/tsconfig.json"
144147
}
145148
}
@@ -157,10 +160,6 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/pr
157160
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project 1 undefined Config: /user/username/projects/project/tsconfig.json WatchType: Wild card directory
158161
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/project/tsconfig.json
159162
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
160-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
161-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
162-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
163-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
164163
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
165164
Info seq [hh:mm:ss:mss] Project '/user/username/projects/project/tsconfig.json' (Configured)
166165
Info seq [hh:mm:ss:mss] Files (2)
@@ -208,7 +207,10 @@ Info seq [hh:mm:ss:mss] event:
208207
"deferredSize": 0
209208
},
210209
"compilerOptions": {
211-
"module": "commonjs"
210+
"module": "commonjs",
211+
"types": [
212+
""
213+
]
212214
},
213215
"typeAcquisition": {
214216
"enable": false,
@@ -258,12 +260,6 @@ Info seq [hh:mm:ss:mss] response:
258260
}
259261
After request
260262

261-
PolledWatches::
262-
/user/username/projects/node_modules/@types: *new*
263-
{"pollingInterval":500}
264-
/user/username/projects/project/node_modules/@types: *new*
265-
{"pollingInterval":500}
266-
267263
FsWatches::
268264
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
269265
{}

tests/baselines/reference/tsserver/autoImportProvider/Does-not-schedule-ensureProjectForOpenFiles-on-AutoImportProviderProject-creation.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export declare class PatternValidator {}
1010
{ "name": "@angular/forms", "typings": "./forms.d.ts" }
1111

1212
//// [/user/username/projects/project/tsconfig.json]
13-
{ "compilerOptions": { "module": "commonjs" } }
13+
{ "compilerOptions": { "module": "commonjs", "types": ["*"] } }
1414

1515
//// [/user/username/projects/project/index.ts]
1616

@@ -72,6 +72,9 @@ Info seq [hh:mm:ss:mss] Config: /user/username/projects/project/tsconfig.json :
7272
],
7373
"options": {
7474
"module": 1,
75+
"types": [
76+
"*"
77+
],
7578
"configFilePath": "/user/username/projects/project/tsconfig.json"
7679
}
7780
}
@@ -89,10 +92,6 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/pr
8992
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project 1 undefined Config: /user/username/projects/project/tsconfig.json WatchType: Wild card directory
9093
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/project/tsconfig.json
9194
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
92-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
93-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
94-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
95-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
9695
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
9796
Info seq [hh:mm:ss:mss] Project '/user/username/projects/project/tsconfig.json' (Configured)
9897
Info seq [hh:mm:ss:mss] Files (2)
@@ -139,7 +138,10 @@ Info seq [hh:mm:ss:mss] event:
139138
"deferredSize": 0
140139
},
141140
"compilerOptions": {
142-
"module": "commonjs"
141+
"module": "commonjs",
142+
"types": [
143+
""
144+
]
143145
},
144146
"typeAcquisition": {
145147
"enable": false,
@@ -189,12 +191,6 @@ Info seq [hh:mm:ss:mss] response:
189191
}
190192
After request
191193

192-
PolledWatches::
193-
/user/username/projects/node_modules/@types: *new*
194-
{"pollingInterval":500}
195-
/user/username/projects/project/node_modules/@types: *new*
196-
{"pollingInterval":500}
197-
198194
FsWatches::
199195
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
200196
{}
@@ -273,12 +269,6 @@ Before running Timeout callback:: count: 2
273269
{ "dependencies": { "@angular/forms": "*", "@angular/core": "*" } }
274270

275271

276-
PolledWatches::
277-
/user/username/projects/node_modules/@types:
278-
{"pollingInterval":500}
279-
/user/username/projects/project/node_modules/@types:
280-
{"pollingInterval":500}
281-
282272
FsWatches::
283273
/home/src/tslibs/TS/Lib/lib.d.ts:
284274
{}

tests/baselines/reference/tsserver/autoImportProvider/Recovers-from-an-unparseable-package_json.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export declare class PatternValidator {}
1010
{ "name": "@angular/forms", "typings": "./forms.d.ts" }
1111

1212
//// [/user/username/projects/project/tsconfig.json]
13-
{ "compilerOptions": { "module": "commonjs" } }
13+
{ "compilerOptions": { "module": "commonjs", "types": ["*"] } }
1414

1515
//// [/user/username/projects/project/package.json]
1616
{
@@ -75,6 +75,9 @@ Info seq [hh:mm:ss:mss] Config: /user/username/projects/project/tsconfig.json :
7575
],
7676
"options": {
7777
"module": 1,
78+
"types": [
79+
"*"
80+
],
7881
"configFilePath": "/user/username/projects/project/tsconfig.json"
7982
}
8083
}
@@ -92,10 +95,6 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/pr
9295
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project 1 undefined Config: /user/username/projects/project/tsconfig.json WatchType: Wild card directory
9396
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/project/tsconfig.json
9497
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
95-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
96-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
97-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
98-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/project/tsconfig.json WatchType: Type roots
9998
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
10099
Info seq [hh:mm:ss:mss] Project '/user/username/projects/project/tsconfig.json' (Configured)
101100
Info seq [hh:mm:ss:mss] Files (2)
@@ -143,7 +142,10 @@ Info seq [hh:mm:ss:mss] event:
143142
"deferredSize": 0
144143
},
145144
"compilerOptions": {
146-
"module": "commonjs"
145+
"module": "commonjs",
146+
"types": [
147+
""
148+
]
147149
},
148150
"typeAcquisition": {
149151
"enable": false,
@@ -193,12 +195,6 @@ Info seq [hh:mm:ss:mss] response:
193195
}
194196
After request
195197

196-
PolledWatches::
197-
/user/username/projects/node_modules/@types: *new*
198-
{"pollingInterval":500}
199-
/user/username/projects/project/node_modules/@types: *new*
200-
{"pollingInterval":500}
201-
202198
FsWatches::
203199
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
204200
{}
@@ -260,12 +256,6 @@ Info seq [hh:mm:ss:mss] Files (1)
260256
Info seq [hh:mm:ss:mss] -----------------------------------------------
261257
After getAutoImportProvider
262258

263-
PolledWatches::
264-
/user/username/projects/node_modules/@types:
265-
{"pollingInterval":500}
266-
/user/username/projects/project/node_modules/@types:
267-
{"pollingInterval":500}
268-
269259
FsWatches::
270260
/home/src/tslibs/TS/Lib/lib.d.ts:
271261
{}

0 commit comments

Comments
 (0)