@@ -1270,6 +1270,46 @@ export default test;`;
1270
1270
checkOutputErrorsIncremental ( host , expectedErrors ) ;
1271
1271
}
1272
1272
} ) ;
1273
+
1274
+ it ( "updates errors when deep import file changes" , ( ) => {
1275
+ const currentDirectory = "/user/username/projects/myproject" ;
1276
+ const aFile : File = {
1277
+ path : `${ currentDirectory } /a.ts` ,
1278
+ content : `import {B} from './b';
1279
+ declare var console: any;
1280
+ let b = new B();
1281
+ console.log(b.c.d);`
1282
+ } ;
1283
+ const bFile : File = {
1284
+ path : `${ currentDirectory } /b.ts` ,
1285
+ content : `import {C} from './c';
1286
+ export class B
1287
+ {
1288
+ c = new C();
1289
+ }`
1290
+ } ;
1291
+ const cFile : File = {
1292
+ path : `${ currentDirectory } /c.ts` ,
1293
+ content : `export class C
1294
+ {
1295
+ d = 1;
1296
+ }`
1297
+ } ;
1298
+ const config : File = {
1299
+ path : `${ currentDirectory } /tsconfig.json` ,
1300
+ content : `{}`
1301
+ } ;
1302
+ const files = [ aFile , bFile , cFile , config , libFile ] ;
1303
+ const host = createWatchedSystem ( files , { currentDirectory } ) ;
1304
+ const watch = createWatchOfConfigFile ( "tsconfig.json" , host ) ;
1305
+ checkProgramActualFiles ( watch ( ) , [ aFile . path , bFile . path , cFile . path , libFile . path ] ) ;
1306
+ checkOutputErrorsInitial ( host , emptyArray ) ;
1307
+ host . writeFile ( cFile . path , cFile . content . replace ( "d" , "d2" ) ) ;
1308
+ host . runQueuedTimeoutCallbacks ( ) ;
1309
+ checkOutputErrorsIncremental ( host , [
1310
+ getDiagnosticOfFileFromProgram ( watch ( ) , aFile . path , aFile . content . lastIndexOf ( "d" ) , 1 , Diagnostics . Property_0_does_not_exist_on_type_1 , "d" , "C" )
1311
+ ] ) ;
1312
+ } ) ;
1273
1313
} ) ;
1274
1314
1275
1315
describe ( "tsc-watch emit with outFile or out setting" , ( ) => {
0 commit comments