@@ -234,11 +234,21 @@ describe('importType(name)', function () {
234
234
it ( '`isExternalModule` works with windows directory separator' , function ( ) {
235
235
const context = testContext ( ) ;
236
236
expect ( isExternalModule ( 'foo' , { } , 'E:\\path\\to\\node_modules\\foo' , context ) ) . to . equal ( true ) ;
237
+ expect ( isExternalModule ( '@foo/bar' , { } , 'E:\\path\\to\\node_modules\\@foo\\bar' , context ) ) . to . equal ( true ) ;
237
238
expect ( isExternalModule ( 'foo' , {
238
239
'import/external-module-folders' : [ 'E:\\path\\to\\node_modules' ] ,
239
240
} , 'E:\\path\\to\\node_modules\\foo' , context ) ) . to . equal ( true ) ;
240
241
} ) ;
241
242
243
+ it ( '`isExternalModule` works with unix directory separator' , function ( ) {
244
+ const context = testContext ( ) ;
245
+ expect ( isExternalModule ( 'foo' , { } , '/path/to/node_modules/foo' , context ) ) . to . equal ( true ) ;
246
+ expect ( isExternalModule ( '@foo/bar' , { } , '/path/to/node_modules/@foo/bar' , context ) ) . to . equal ( true ) ;
247
+ expect ( isExternalModule ( 'foo' , {
248
+ 'import/external-module-folders' : [ '/path/to/node_modules' ] ,
249
+ } , '/path/to/node_modules/foo' , context ) ) . to . equal ( true ) ;
250
+ } ) ;
251
+
242
252
it ( 'correctly identifies scoped modules with `isScopedModule`' , ( ) => {
243
253
expect ( isScopedModule ( '@/abc' ) ) . to . equal ( false ) ;
244
254
expect ( isScopedModule ( '@/abc/def' ) ) . to . equal ( false ) ;
0 commit comments