Skip to content

Commit 8eb84d6

Browse files
tejbirsinghMylesBorins
authored andcommitted
test: change common.fixturesDir to fixtures.path
Use common.fixtures module instead of common.fixturesDir based on task at Nodejs code and learn at Node.js Interactive 2017 in Vancouver. PR-URL: #15860 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 806f03e commit 8eb84d6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/parallel/test-require-exceptions.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use strict';
22
const common = require('../common');
33
const assert = require('assert');
4+
const fixtures = require('../common/fixtures');
45

56
// A module with an error in it should throw
67
assert.throws(function() {
7-
require(`${common.fixturesDir}/throws_error`);
8+
require(fixtures.path('/throws_error'));
89
}, /^Error: blah$/);
910

1011
// Requiring the same module again should throw as well
1112
assert.throws(function() {
12-
require(`${common.fixturesDir}/throws_error`);
13+
require(fixtures.path('/throws_error'));
1314
}, /^Error: blah$/);
1415

1516
// Requiring a module that does not exist should throw an
@@ -22,13 +23,13 @@ assertModuleNotFound('/module-require/not-found/trailingSlash');
2223

2324
function 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

3233
function assertExists(fixture) {
33-
assert(common.fileExists(common.fixturesDir + fixture));
34+
assert(common.fileExists(fixtures.path(fixture)));
3435
}

0 commit comments

Comments
 (0)