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 2222'use strict' ;
2323const common = require ( '../common' ) ;
2424const assert = require ( 'assert' ) ;
25+ const fixtures = require ( '../common/fixtures' ) ;
2526
2627// A module with an error in it should throw
2728assert . throws ( function ( ) {
28- require ( ` ${ common . fixturesDir } /throws_error` ) ;
29+ require ( fixtures . path ( ' /throws_error' ) ) ;
2930} , / ^ E r r o r : b l a h $ / ) ;
3031
3132// Requiring the same module again should throw as well
3233assert . throws ( function ( ) {
33- require ( ` ${ common . fixturesDir } /throws_error` ) ;
34+ require ( fixtures . path ( ' /throws_error' ) ) ;
3435} , / ^ E r r o r : b l a h $ / ) ;
3536
3637// Requiring a module that does not exist should throw an
@@ -43,13 +44,13 @@ assertModuleNotFound('/module-require/not-found/trailingSlash');
4344
4445function assertModuleNotFound ( path ) {
4546 assert . throws ( function ( ) {
46- require ( common . fixturesDir + path ) ;
47+ require ( fixtures . path ( path ) ) ;
4748 } , function ( e ) {
4849 assert . strictEqual ( e . code , 'MODULE_NOT_FOUND' ) ;
4950 return true ;
5051 } ) ;
5152}
5253
5354function assertExists ( fixture ) {
54- assert ( common . fileExists ( common . fixturesDir + fixture ) ) ;
55+ assert ( common . fileExists ( fixtures . path ( fixture ) ) ) ;
5556}
You can’t perform that action at this time.
0 commit comments