@@ -35,7 +35,7 @@ fs.writeFileSync(dotfileWithExtension, 'console.log(__filename);', 'utf8');
3535 require ( modulePath ) ;
3636 assert . throws (
3737 ( ) => require ( `${ modulePath } .foo` ) ,
38- new Error ( `Cannot find module '${ modulePath } .foo'` )
38+ ( err ) => err . message . startsWith ( `Cannot find module '${ modulePath } .foo'` )
3939 ) ;
4040 require ( `${ modulePath } .foo.bar` ) ;
4141 delete require . cache [ file ] ;
@@ -47,7 +47,7 @@ fs.writeFileSync(dotfileWithExtension, 'console.log(__filename);', 'utf8');
4747 const modulePath = path . join ( tmpdir . path , 'test-extensions' ) ;
4848 assert . throws (
4949 ( ) => require ( modulePath ) ,
50- new Error ( `Cannot find module '${ modulePath } '` )
50+ ( err ) => err . message . startsWith ( `Cannot find module '${ modulePath } '` )
5151 ) ;
5252 delete require . cache [ file ] ;
5353 Module . _pathCache = Object . create ( null ) ;
@@ -69,7 +69,7 @@ fs.writeFileSync(dotfileWithExtension, 'console.log(__filename);', 'utf8');
6969 const modulePath = path . join ( tmpdir . path , 'test-extensions.foo' ) ;
7070 assert . throws (
7171 ( ) => require ( modulePath ) ,
72- new Error ( `Cannot find module '${ modulePath } '` )
72+ ( err ) => err . message . startsWith ( `Cannot find module '${ modulePath } '` )
7373 ) ;
7474 delete require . extensions [ '.foo.bar' ] ;
7575 Module . _pathCache = Object . create ( null ) ;
0 commit comments