Skip to content

Commit 683e48c

Browse files
creisleMylesBorins
authored andcommitted
test: changed fixtures require
PR-URL: #15899 Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent f82f691 commit 683e48c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/sequential/test-require-cache-without-stat.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// We've experienced a regression where the module loader stats a bunch of
33
// directories on require() even if it's been called before. The require()
44
// should caching the request.
5-
const common = require('../common');
5+
require('../common');
66
const fs = require('fs');
77
const assert = require('assert');
8+
const { fixturesDir } = require('../common/fixtures');
89

910
let counter = 0;
1011

@@ -25,7 +26,7 @@ fs.stat = function() {
2526
};
2627

2728
// Load the module 'a' and 'http' once. It should become cached.
28-
require(`${common.fixturesDir}/a`);
29+
require(`${fixturesDir}/a`);
2930
require('../fixtures/a.js');
3031
require('./../fixtures/a.js');
3132
require('http');
@@ -36,7 +37,7 @@ const counterBefore = counter;
3637
// Now load the module a bunch of times with equivalent paths.
3738
// stat should not be called.
3839
for (let i = 0; i < 100; i++) {
39-
require(`${common.fixturesDir}/a`);
40+
require(`${fixturesDir}/a`);
4041
require('../fixtures/a.js');
4142
require('./../fixtures/a.js');
4243
}

0 commit comments

Comments
 (0)