Skip to content

Commit

Permalink
test: changed fixtures require
Browse files Browse the repository at this point in the history
PR-URL: #15899
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
creisle authored and MylesBorins committed Nov 28, 2017
1 parent f82f691 commit 683e48c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/sequential/test-require-cache-without-stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// We've experienced a regression where the module loader stats a bunch of
// directories on require() even if it's been called before. The require()
// should caching the request.
const common = require('../common');
require('../common');
const fs = require('fs');
const assert = require('assert');
const { fixturesDir } = require('../common/fixtures');

let counter = 0;

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

// Load the module 'a' and 'http' once. It should become cached.
require(`${common.fixturesDir}/a`);
require(`${fixturesDir}/a`);
require('../fixtures/a.js');
require('./../fixtures/a.js');
require('http');
Expand All @@ -36,7 +37,7 @@ const counterBefore = counter;
// Now load the module a bunch of times with equivalent paths.
// stat should not be called.
for (let i = 0; i < 100; i++) {
require(`${common.fixturesDir}/a`);
require(`${fixturesDir}/a`);
require('../fixtures/a.js');
require('./../fixtures/a.js');
}
Expand Down

0 comments on commit 683e48c

Please sign in to comment.