@@ -1084,13 +1084,17 @@ const a: string = "hello";`),
10841084 content : Utils . dedent `
10851085 import { something } from "./filePresent";
10861086 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";` ,
10881090 } ,
10891091 {
10901092 path : `${ projectRoot } /src/anotherFileReusingResolution.ts` ,
10911093 content : Utils . dedent `
10921094 import { something } from "./filePresent";
1093- import { something2 } from "./fileNotFound";` ,
1095+ import { something2 } from "./fileNotFound";
1096+ import { externalThing1 } from "externalThing";
1097+ import { externalThing2 } from "externalThingNotPresent";` ,
10941098 } ,
10951099 {
10961100 path : `${ projectRoot } /src/filePresent.ts` ,
@@ -1124,6 +1128,10 @@ const a: string = "hello";`),
11241128 path : `${ projectRoot } /src/globalFilePresent.ts` ,
11251129 content : `function globalSomething() { return 10; }` ,
11261130 } ,
1131+ {
1132+ path : `${ projectRoot } /src/externalThing.d.ts` ,
1133+ content : `export function externalThing1(): number;` ,
1134+ } ,
11271135 {
11281136 path : `${ projectRoot } /tsconfig.json` ,
11291137 content : JSON . stringify ( {
@@ -1219,6 +1227,22 @@ const a: string = "hello";`),
12191227 sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
12201228 }
12211229 } ,
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+ } ,
12221246 ]
12231247 } ) ;
12241248 verifyTscWatch ( {
@@ -1276,6 +1300,22 @@ const a: string = "hello";`),
12761300 sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
12771301 }
12781302 } ,
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+ } ,
12791319 ]
12801320 } ) ;
12811321 verifyTscWatch ( {
@@ -1333,6 +1373,22 @@ const a: string = "hello";`),
13331373 sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
13341374 }
13351375 } ,
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+ } ,
13361392 ]
13371393 } ) ;
13381394
@@ -1391,6 +1447,22 @@ const a: string = "hello";`),
13911447 sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
13921448 }
13931449 } ,
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+ } ,
13941466 ]
13951467 } ) ;
13961468 verifyTscWatch ( {
@@ -1448,6 +1520,22 @@ const a: string = "hello";`),
14481520 sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
14491521 }
14501522 } ,
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+ } ,
14511539 ]
14521540 } ) ;
14531541 verifyTscWatch ( {
@@ -1505,6 +1593,22 @@ const a: string = "hello";`),
15051593 sys . runQueuedTimeoutCallbacks ( ) ; // Actual update
15061594 }
15071595 } ,
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+ } ,
15081612 ]
15091613 } ) ;
15101614 } ) ;
0 commit comments