File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22const common = require ( '../common' ) ;
33const assert = require ( 'assert' ) ;
4+ const fixtures = require ( '../common/fixtures' ) ;
45
56// A module with an error in it should throw
67assert . throws ( function ( ) {
7- require ( ` ${ common . fixturesDir } /throws_error` ) ;
8+ require ( fixtures . path ( ' /throws_error' ) ) ;
89} , / ^ E r r o r : b l a h $ / ) ;
910
1011// Requiring the same module again should throw as well
1112assert . throws ( function ( ) {
12- require ( ` ${ common . fixturesDir } /throws_error` ) ;
13+ require ( fixtures . path ( ' /throws_error' ) ) ;
1314} , / ^ E r r o r : b l a h $ / ) ;
1415
1516// Requiring a module that does not exist should throw an
@@ -22,13 +23,13 @@ assertModuleNotFound('/module-require/not-found/trailingSlash');
2223
2324function assertModuleNotFound ( path ) {
2425 assert . throws ( function ( ) {
25- require ( common . fixturesDir + path ) ;
26+ require ( fixtures . path ( path ) ) ;
2627 } , function ( e ) {
2728 assert . strictEqual ( e . code , 'MODULE_NOT_FOUND' ) ;
2829 return true ;
2930 } ) ;
3031}
3132
3233function assertExists ( fixture ) {
33- assert ( common . fileExists ( common . fixturesDir + fixture ) ) ;
34+ assert ( common . fileExists ( fixtures . path ( fixture ) ) ) ;
3435}
You can’t perform that action at this time.
0 commit comments