Skip to content

Commit 081a381

Browse files
committed
Reset target for less baseline change
1 parent 77a931b commit 081a381

File tree

3 files changed

+63
-89
lines changed

3 files changed

+63
-89
lines changed

src/testRunner/unittests/tscWatch/moduleResolution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ describe("unittests:: tsc-watch:: moduleResolution", () => {
284284
{
285285
path: `/user/username/projects/myproject/tsconfig.json`,
286286
content: JSON.stringify({
287-
compilerOptions: { module: "node16", moduleResolution: "node16" },
287+
compilerOptions: { target: "es5", module: "node16", moduleResolution: "node16" },
288288
})
289289
},
290290
{
@@ -354,7 +354,7 @@ describe("unittests:: tsc-watch:: moduleResolution", () => {
354354
{
355355
path: `/user/username/projects/myproject/tsconfig.json`,
356356
content: JSON.stringify({
357-
compilerOptions: { module: "node16", moduleResolution: "node16" },
357+
compilerOptions: { target: "es5", module: "node16", moduleResolution: "node16" },
358358
})
359359
},
360360
{

tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
currentDirectory:: /user/username/projects/myproject useCaseSensitiveFileNames: false
22
Input::
33
//// [/user/username/projects/myproject/tsconfig.json]
4-
{"compilerOptions":{"module":"node16","moduleResolution":"node16"}}
4+
{"compilerOptions":{"target":"es5","module":"node16","moduleResolution":"node16"}}
55

66
//// [/user/username/projects/myproject/index.ts]
77
import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
@@ -131,48 +131,37 @@ File '/user/username/projects/myproject/node_modules/pkg/package.json' exists ac
131131
File '/a/lib/package.json' does not exist.
132132
File '/a/package.json' does not exist.
133133
File '/package.json' does not exist according to earlier cached lookups.
134-
[91merror[0m[90m TS2318: [0mCannot find global type 'Array'.
134+
[96mindex.ts[0m:[93m2[0m:[93m39[0m - [91merror[0m[90m TS2307: [0mCannot find module 'pkg1' or its corresponding type declarations.
135135

136-
error TS2318: Cannot find global type 'Boolean'.
136+
2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" };
137+
   ~~~~~~
137138

138-
error TS2318: Cannot find global type 'Function'.
139-
140-
error TS2318: Cannot find global type 'IArguments'.
141-
142-
error TS2318: Cannot find global type 'Number'.
143-
144-
error TS2318: Cannot find global type 'Object'.
145-
146-
error TS2318: Cannot find global type 'RegExp'.
147-
148-
error TS2318: Cannot find global type 'String'.
149-
150-
error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found.
151-
The file is in the program because:
152-
Default library for target 'es2022'
153-
154-
[12:00:44 AM] Found 9 errors. Watching for file changes.
139+
[12:00:44 AM] Found 1 error. Watching for file changes.
155140

156141

157142

158143
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"]
159-
Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
144+
Program options: {"target":1,"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
160145
Program structureReused: Not
161146
Program files::
147+
/a/lib/lib.d.ts
162148
/user/username/projects/myproject/a.ts
163149
/user/username/projects/myproject/node_modules/pkg/import.d.ts
164150
/user/username/projects/myproject/index.ts
165151

166-
No cached semantic diagnostics in the builder::
152+
Semantic diagnostics in builder refreshed for::
153+
/a/lib/lib.d.ts
154+
/user/username/projects/myproject/a.ts
155+
/user/username/projects/myproject/node_modules/pkg/import.d.ts
156+
/user/username/projects/myproject/index.ts
167157

168158
Shape signatures in builder refreshed for::
159+
/a/lib/lib.d.ts (used version)
169160
/user/username/projects/myproject/a.ts (used version)
170-
/user/username/projects/myproject/index.ts (used version)
171161
/user/username/projects/myproject/node_modules/pkg/import.d.ts (used version)
162+
/user/username/projects/myproject/index.ts (used version)
172163

173164
PolledWatches::
174-
/a/lib/lib.es2022.full.d.ts: *new*
175-
{"pollingInterval":500}
176165
/user/username/projects/myproject/node_modules/@types: *new*
177166
{"pollingInterval":500}
178167
/user/username/projects/myproject/package.json: *new*
@@ -185,6 +174,8 @@ PolledWatches::
185174
{"pollingInterval":2000}
186175

187176
FsWatches::
177+
/a/lib/lib.d.ts: *new*
178+
{}
188179
/user/username/projects: *new*
189180
{}
190181
/user/username/projects/myproject: *new*
@@ -238,6 +229,9 @@ Output::
238229
>> Screen clear
239230
[12:00:47 AM] File change detected. Starting incremental compilation...
240231

232+
File '/a/lib/package.json' does not exist according to earlier cached lookups.
233+
File '/a/package.json' does not exist according to earlier cached lookups.
234+
File '/package.json' does not exist according to earlier cached lookups.
241235
File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups.
242236
File '/user/username/projects/package.json' does not exist according to earlier cached lookups.
243237
File '/user/username/package.json' does not exist according to earlier cached lookups.
@@ -288,39 +282,27 @@ Reusing resolution of module 'pkg1' from '/user/username/projects/myproject/inde
288282
File '/a/lib/package.json' does not exist according to earlier cached lookups.
289283
File '/a/package.json' does not exist according to earlier cached lookups.
290284
File '/package.json' does not exist according to earlier cached lookups.
291-
error TS2318: Cannot find global type 'Array'.
292-
293-
error TS2318: Cannot find global type 'Boolean'.
294-
295-
error TS2318: Cannot find global type 'Function'.
296-
297-
error TS2318: Cannot find global type 'IArguments'.
285+
index.ts:2:39 - error TS2307: Cannot find module 'pkg1' or its corresponding type declarations.
298286

299-
error TS2318: Cannot find global type 'Number'.
287+
2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" };
288+
   ~~~~~~
300289

301-
error TS2318: Cannot find global type 'Object'.
302-
303-
error TS2318: Cannot find global type 'RegExp'.
304-
305-
error TS2318: Cannot find global type 'String'.
306-
307-
error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found.
308-
The file is in the program because:
309-
Default library for target 'es2022'
310-
311-
[12:00:54 AM] Found 9 errors. Watching for file changes.
290+
[12:00:54 AM] Found 1 error. Watching for file changes.
312291

313292

314293

315294
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"]
316-
Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
295+
Program options: {"target":1,"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
317296
Program structureReused: SafeModules
318297
Program files::
298+
/a/lib/lib.d.ts
319299
/user/username/projects/myproject/node_modules/pkg/import.d.ts
320300
/user/username/projects/myproject/a.ts
321301
/user/username/projects/myproject/index.ts
322302

323-
No cached semantic diagnostics in the builder::
303+
Semantic diagnostics in builder refreshed for::
304+
/user/username/projects/myproject/a.ts
305+
/user/username/projects/myproject/index.ts
324306

325307
Shape signatures in builder refreshed for::
326308
/user/username/projects/myproject/a.ts (computed .d.ts)

tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js

Lines changed: 33 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
currentDirectory:: /user/username/projects/myproject useCaseSensitiveFileNames: false
22
Input::
33
//// [/user/username/projects/myproject/tsconfig.json]
4-
{"compilerOptions":{"module":"node16","moduleResolution":"node16"}}
4+
{"compilerOptions":{"target":"es5","module":"node16","moduleResolution":"node16"}}
55

66
//// [/user/username/projects/myproject/index.ts]
77
/// <reference types="pkg" resolution-mode="import"/>
@@ -131,50 +131,45 @@ File '/package.json' does not exist according to earlier cached lookups.
131131
File '/a/lib/package.json' does not exist.
132132
File '/a/package.json' does not exist.
133133
File '/package.json' does not exist according to earlier cached lookups.
134-
[91merror[0m[90m TS2318: [0mCannot find global type 'Array'.
134+
[96mindex.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg1'.
135135

136-
error TS2318: Cannot find global type 'Boolean'.
136+
2 /// <reference types="pkg1" resolution-mode="require"/>
137+
   ~~~~
137138

138-
[91merror[0m[90m TS2318: [0mCannot find global type 'Function'.
139+
[96mindex.ts[0m:[93m3[0m:[93m41[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface'.
139140

140-
error TS2318: Cannot find global type 'IArguments'.
141+
3 export interface LocalInterface extends RequireInterface {}
142+
   ~~~~~~~~~~~~~~~~
141143

142-
error TS2318: Cannot find global type 'Number'.
143-
144-
error TS2318: Cannot find global type 'Object'.
145-
146-
error TS2318: Cannot find global type 'RegExp'.
147-
148-
error TS2318: Cannot find global type 'String'.
149-
150-
error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found.
151-
The file is in the program because:
152-
Default library for target 'es2022'
153-
154-
[12:00:50 AM] Found 9 errors. Watching for file changes.
144+
[12:00:50 AM] Found 2 errors. Watching for file changes.
155145

156146

157147

158148
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"]
159-
Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
149+
Program options: {"target":1,"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
160150
Program structureReused: Not
161151
Program files::
152+
/a/lib/lib.d.ts
162153
/user/username/projects/myproject/a.ts
163154
/user/username/projects/myproject/node_modules/pkg/import.d.ts
164155
/user/username/projects/myproject/index.ts
165156
/user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts
166157

167-
No cached semantic diagnostics in the builder::
158+
Semantic diagnostics in builder refreshed for::
159+
/a/lib/lib.d.ts
160+
/user/username/projects/myproject/a.ts
161+
/user/username/projects/myproject/node_modules/pkg/import.d.ts
162+
/user/username/projects/myproject/index.ts
163+
/user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts
168164

169165
Shape signatures in builder refreshed for::
166+
/a/lib/lib.d.ts (used version)
170167
/user/username/projects/myproject/a.ts (used version)
171168
/user/username/projects/myproject/node_modules/pkg/import.d.ts (used version)
172169
/user/username/projects/myproject/index.ts (used version)
173170
/user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts (used version)
174171

175172
PolledWatches::
176-
/a/lib/lib.es2022.full.d.ts: *new*
177-
{"pollingInterval":500}
178173
/user/username/projects/myproject/node_modules/@types/package.json: *new*
179174
{"pollingInterval":2000}
180175
/user/username/projects/myproject/node_modules/@types/pkg2/package.json: *new*
@@ -191,6 +186,8 @@ PolledWatches::
191186
{"pollingInterval":2000}
192187

193188
FsWatches::
189+
/a/lib/lib.d.ts: *new*
190+
{}
194191
/user/username/projects/myproject/a.ts: *new*
195192
{}
196193
/user/username/projects/myproject/index.ts: *new*
@@ -247,6 +244,9 @@ Output::
247244
>> Screen clear
248245
[12:00:53 AM] File change detected. Starting incremental compilation...
249246

247+
File '/a/lib/package.json' does not exist according to earlier cached lookups.
248+
File '/a/package.json' does not exist according to earlier cached lookups.
249+
File '/package.json' does not exist according to earlier cached lookups.
250250
File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups.
251251
File '/user/username/projects/package.json' does not exist according to earlier cached lookups.
252252
File '/user/username/package.json' does not exist according to earlier cached lookups.
@@ -309,40 +309,32 @@ File '/package.json' does not exist according to earlier cached lookups.
309309
File '/a/lib/package.json' does not exist according to earlier cached lookups.
310310
File '/a/package.json' does not exist according to earlier cached lookups.
311311
File '/package.json' does not exist according to earlier cached lookups.
312-
error TS2318: Cannot find global type 'Array'.
313-
314-
error TS2318: Cannot find global type 'Boolean'.
312+
index.ts:2:23 - error TS2688: Cannot find type definition file for 'pkg1'.
315313

316-
error TS2318: Cannot find global type 'Function'.
314+
2 /// <reference types="pkg1" resolution-mode="require"/>
315+
   ~~~~
317316

318-
[91merror[0m[90m TS2318: [0mCannot find global type 'IArguments'.
317+
[96mindex.ts[0m:[93m3[0m:[93m41[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface'.
319318

320-
error TS2318: Cannot find global type 'Number'.
319+
3 export interface LocalInterface extends RequireInterface {}
320+
   ~~~~~~~~~~~~~~~~
321321

322-
error TS2318: Cannot find global type 'Object'.
323-
324-
error TS2318: Cannot find global type 'RegExp'.
325-
326-
error TS2318: Cannot find global type 'String'.
327-
328-
error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found.
329-
The file is in the program because:
330-
Default library for target 'es2022'
331-
332-
[12:00:57 AM] Found 9 errors. Watching for file changes.
322+
[12:00:57 AM] Found 2 errors. Watching for file changes.
333323

334324

335325

336326
Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"]
337-
Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
327+
Program options: {"target":1,"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"}
338328
Program structureReused: SafeModules
339329
Program files::
330+
/a/lib/lib.d.ts
340331
/user/username/projects/myproject/node_modules/pkg/import.d.ts
341332
/user/username/projects/myproject/a.ts
342333
/user/username/projects/myproject/index.ts
343334
/user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts
344335

345-
No cached semantic diagnostics in the builder::
336+
Semantic diagnostics in builder refreshed for::
337+
/user/username/projects/myproject/a.ts
346338

347339
Shape signatures in builder refreshed for::
348340
/user/username/projects/myproject/a.ts (computed .d.ts)

0 commit comments

Comments
 (0)