File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2
2
// We've experienced a regression where the module loader stats a bunch of
3
3
// directories on require() even if it's been called before. The require()
4
4
// should caching the request.
5
- const common = require ( '../common' ) ;
5
+ require ( '../common' ) ;
6
6
const fs = require ( 'fs' ) ;
7
7
const assert = require ( 'assert' ) ;
8
+ const { fixturesDir } = require ( '../common/fixtures' ) ;
8
9
9
10
let counter = 0 ;
10
11
@@ -25,7 +26,7 @@ fs.stat = function() {
25
26
} ;
26
27
27
28
// Load the module 'a' and 'http' once. It should become cached.
28
- require ( `${ common . fixturesDir } /a` ) ;
29
+ require ( `${ fixturesDir } /a` ) ;
29
30
require ( '../fixtures/a.js' ) ;
30
31
require ( './../fixtures/a.js' ) ;
31
32
require ( 'http' ) ;
@@ -36,7 +37,7 @@ const counterBefore = counter;
36
37
// Now load the module a bunch of times with equivalent paths.
37
38
// stat should not be called.
38
39
for ( let i = 0 ; i < 100 ; i ++ ) {
39
- require ( `${ common . fixturesDir } /a` ) ;
40
+ require ( `${ fixturesDir } /a` ) ;
40
41
require ( '../fixtures/a.js' ) ;
41
42
require ( './../fixtures/a.js' ) ;
42
43
}
You can’t perform that action at this time.
0 commit comments