@@ -213,5 +213,23 @@ function fooB() { }`
213
213
assert . isFalse ( project . dirty ) ;
214
214
checkProjectActualFiles ( project , [ libFile . path , file1 . path , file2 . path , file3 . path , something . path ] ) ;
215
215
} ) ;
216
+
217
+ it ( "should not crash when external module name resolution is reused" , ( ) => {
218
+ const { session, file1, file2, file3 } = setup ( ) ;
219
+ const service = session . getProjectService ( ) ;
220
+ openFilesForSession ( [ file1 ] , session ) ;
221
+ checkNumberOfProjects ( service , { inferredProjects : 1 } ) ;
222
+ const project = service . inferredProjects [ 0 ] ;
223
+ checkProjectActualFiles ( project , [ libFile . path , file1 . path , file2 . path ] ) ;
224
+
225
+ // Close the file that contains non relative external module name and open some file that doesnt have non relative external module import
226
+ closeFilesForSession ( [ file1 ] , session ) ;
227
+ openFilesForSession ( [ file3 ] , session ) ;
228
+ checkProjectActualFiles ( project , [ libFile . path , file3 . path ] ) ;
229
+
230
+ // Open file with non relative external module name
231
+ openFilesForSession ( [ file2 ] , session ) ;
232
+ checkProjectActualFiles ( project , [ libFile . path , file2 . path , file3 . path ] ) ;
233
+ } ) ;
216
234
} ) ;
217
235
}
0 commit comments