@@ -1084,13 +1084,17 @@ const a: string = "hello";`),
1084
1084
content : Utils . dedent `
1085
1085
import { something } from "./filePresent";
1086
1086
import { something as something1 } from "./filePresent";
1087
- import { something2 } from "./fileNotFound";` ,
1087
+ import { something2 } from "./fileNotFound";
1088
+ import { externalThing1 } from "externalThing";
1089
+ import { externalThing2 } from "externalThingNotPresent";` ,
1088
1090
} ,
1089
1091
{
1090
1092
path : `${ projectRoot } /src/anotherFileReusingResolution.ts` ,
1091
1093
content : Utils . dedent `
1092
1094
import { something } from "./filePresent";
1093
- import { something2 } from "./fileNotFound";` ,
1095
+ import { something2 } from "./fileNotFound";
1096
+ import { externalThing1 } from "externalThing";
1097
+ import { externalThing2 } from "externalThingNotPresent";` ,
1094
1098
} ,
1095
1099
{
1096
1100
path : `${ projectRoot } /src/filePresent.ts` ,
@@ -1124,6 +1128,10 @@ const a: string = "hello";`),
1124
1128
path : `${ projectRoot } /src/globalFilePresent.ts` ,
1125
1129
content : `function globalSomething() { return 10; }` ,
1126
1130
} ,
1131
+ {
1132
+ path : `${ projectRoot } /src/externalThing.d.ts` ,
1133
+ content : `export function externalThing1(): number;` ,
1134
+ } ,
1127
1135
{
1128
1136
path : `${ projectRoot } /tsconfig.json` ,
1129
1137
content : JSON . stringify ( {
@@ -1219,6 +1227,22 @@ const a: string = "hello";`),
1219
1227
sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1220
1228
}
1221
1229
} ,
1230
+ {
1231
+ caption : "Create external module file that could not be resolved" ,
1232
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThingNotPresent.ts` , "export function externalThing2() { return 20; }" ) ,
1233
+ timeouts : sys => {
1234
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1235
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1236
+ }
1237
+ } ,
1238
+ {
1239
+ caption : "Write .ts file that takes preference over resolved .d.ts file" ,
1240
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThing.ts` , "export function externalThing1() { return 10; }" ) ,
1241
+ timeouts : sys => {
1242
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1243
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1244
+ }
1245
+ } ,
1222
1246
]
1223
1247
} ) ;
1224
1248
verifyTscWatch ( {
@@ -1276,6 +1300,22 @@ const a: string = "hello";`),
1276
1300
sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1277
1301
}
1278
1302
} ,
1303
+ {
1304
+ caption : "Create external module file that could not be resolved" ,
1305
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThingNotPresent.ts` , "export function externalThing2() { return 20; }" ) ,
1306
+ timeouts : sys => {
1307
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1308
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1309
+ }
1310
+ } ,
1311
+ {
1312
+ caption : "Write .ts file that takes preference over resolved .d.ts file" ,
1313
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThing.ts` , "export function externalThing1() { return 10; }" ) ,
1314
+ timeouts : sys => {
1315
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1316
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1317
+ }
1318
+ } ,
1279
1319
]
1280
1320
} ) ;
1281
1321
verifyTscWatch ( {
@@ -1333,6 +1373,22 @@ const a: string = "hello";`),
1333
1373
sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1334
1374
}
1335
1375
} ,
1376
+ {
1377
+ caption : "Create external module file that could not be resolved" ,
1378
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThingNotPresent.ts` , "export function externalThing2() { return 20; }" ) ,
1379
+ timeouts : sys => {
1380
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1381
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1382
+ }
1383
+ } ,
1384
+ {
1385
+ caption : "Write .ts file that takes preference over resolved .d.ts file" ,
1386
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThing.ts` , "export function externalThing1() { return 10; }" ) ,
1387
+ timeouts : sys => {
1388
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1389
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1390
+ }
1391
+ } ,
1336
1392
]
1337
1393
} ) ;
1338
1394
@@ -1391,6 +1447,22 @@ const a: string = "hello";`),
1391
1447
sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1392
1448
}
1393
1449
} ,
1450
+ {
1451
+ caption : "Create external module file that could not be resolved" ,
1452
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThingNotPresent.ts` , "export function externalThing2() { return 20; }" ) ,
1453
+ timeouts : sys => {
1454
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1455
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1456
+ }
1457
+ } ,
1458
+ {
1459
+ caption : "Write .ts file that takes preference over resolved .d.ts file" ,
1460
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThing.ts` , "export function externalThing1() { return 10; }" ) ,
1461
+ timeouts : sys => {
1462
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1463
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1464
+ }
1465
+ } ,
1394
1466
]
1395
1467
} ) ;
1396
1468
verifyTscWatch ( {
@@ -1448,6 +1520,22 @@ const a: string = "hello";`),
1448
1520
sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1449
1521
}
1450
1522
} ,
1523
+ {
1524
+ caption : "Create external module file that could not be resolved" ,
1525
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThingNotPresent.ts` , "export function externalThing2() { return 20; }" ) ,
1526
+ timeouts : sys => {
1527
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1528
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1529
+ }
1530
+ } ,
1531
+ {
1532
+ caption : "Write .ts file that takes preference over resolved .d.ts file" ,
1533
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThing.ts` , "export function externalThing1() { return 10; }" ) ,
1534
+ timeouts : sys => {
1535
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1536
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1537
+ }
1538
+ } ,
1451
1539
]
1452
1540
} ) ;
1453
1541
verifyTscWatch ( {
@@ -1505,6 +1593,22 @@ const a: string = "hello";`),
1505
1593
sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1506
1594
}
1507
1595
} ,
1596
+ {
1597
+ caption : "Create external module file that could not be resolved" ,
1598
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThingNotPresent.ts` , "export function externalThing2() { return 20; }" ) ,
1599
+ timeouts : sys => {
1600
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1601
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1602
+ }
1603
+ } ,
1604
+ {
1605
+ caption : "Write .ts file that takes preference over resolved .d.ts file" ,
1606
+ change : sys => sys . writeFile ( `${ projectRoot } /src/externalThing.ts` , "export function externalThing1() { return 10; }" ) ,
1607
+ timeouts : sys => {
1608
+ sys . runQueuedTimeoutCallbacks ( ) ; // Invalidate resolutions
1609
+ sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
1610
+ }
1611
+ } ,
1508
1612
]
1509
1613
} ) ;
1510
1614
} ) ;
0 commit comments