@@ -240,6 +240,17 @@ ruleTester.run("no-missing-require", rule, {
240
240
code : "require('jquery.cookie');" ,
241
241
options : [ { allowModules : [ "jquery.cookie" ] } ] ,
242
242
} ,
243
+ // allow virtual modules
244
+ {
245
+ filename : fixture ( "test.js" ) ,
246
+ code : "require('virtual:package-name');" ,
247
+ options : [ { allowModules : [ "virtual:package-name" ] } ] ,
248
+ } ,
249
+ {
250
+ filename : fixture ( "test.js" ) ,
251
+ code : "require('virtual:package-scope/name');" ,
252
+ options : [ { allowModules : [ "virtual:package-scope" ] } ] ,
253
+ } ,
243
254
244
255
// typescriptExtensionMap
245
256
{
@@ -440,6 +451,18 @@ ruleTester.run("no-missing-require", rule, {
440
451
code : "require.resolve('no-exist-package-0');" ,
441
452
errors : cantResolve ( "no-exist-package-0" ) ,
442
453
} ,
454
+
455
+ // Virtual modules
456
+ {
457
+ filename : fixture ( "test.js" ) ,
458
+ code : "require('virtual:package-name');" ,
459
+ errors : cantResolve ( "virtual:package-name" ) ,
460
+ } ,
461
+ {
462
+ filename : fixture ( "test.js" ) ,
463
+ code : "require('virtual:package-scope/name');" ,
464
+ errors : cantResolve ( "virtual:package-scope/name" ) ,
465
+ } ,
443
466
] ,
444
467
} )
445
468
0 commit comments