File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,21 @@ namespace ts {
194
194
} ) ;
195
195
196
196
describe ( "Node module resolution - non-relative paths" , ( ) => {
197
+ it ( "computes correct commonPrefix for moduleName cache" , ( ) => {
198
+ const cache = createModuleResolutionCache ( "/" , ( f ) => f ) . getOrCreateCacheForModuleName ( "a" ) ;
199
+ cache . set ( "/sub" , {
200
+ resolvedModule : {
201
+ originalPath : undefined ,
202
+ resolvedFileName : "/sub/node_modules/a/index.ts" ,
203
+ isExternalLibraryImport : true ,
204
+ extension : Extension . Ts ,
205
+ } ,
206
+ failedLookupLocations : [ ] ,
207
+ } ) ;
208
+ assert . isDefined ( cache . get ( "/sub" ) ) ;
209
+ assert . isUndefined ( cache . get ( "/" ) ) ;
210
+ } ) ;
211
+
197
212
it ( "load module as file - ts files not loaded" , ( ) => {
198
213
test ( /*hasDirectoryExists*/ false ) ;
199
214
test ( /*hasDirectoryExists*/ true ) ;
You can’t perform that action at this time.
0 commit comments