From 8eb84d6780d31803e5529b94384793db34cfeb06 Mon Sep 17 00:00:00 2001 From: tejbirsingh Date: Fri, 6 Oct 2017 09:59:04 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/15860 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Gireesh Punathil Reviewed-By: Richard Lau Reviewed-By: Benjamin Gruenbaum Reviewed-By: Joyee Cheung --- test/parallel/test-require-exceptions.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-require-exceptions.js b/test/parallel/test-require-exceptions.js index 4af19ef7e68971..8fb49839d25ec2 100644 --- a/test/parallel/test-require-exceptions.js +++ b/test/parallel/test-require-exceptions.js @@ -1,15 +1,16 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); +const fixtures = require('../common/fixtures'); // A module with an error in it should throw assert.throws(function() { - require(`${common.fixturesDir}/throws_error`); + require(fixtures.path('/throws_error')); }, /^Error: blah$/); // Requiring the same module again should throw as well assert.throws(function() { - require(`${common.fixturesDir}/throws_error`); + require(fixtures.path('/throws_error')); }, /^Error: blah$/); // Requiring a module that does not exist should throw an @@ -22,7 +23,7 @@ assertModuleNotFound('/module-require/not-found/trailingSlash'); function assertModuleNotFound(path) { assert.throws(function() { - require(common.fixturesDir + path); + require(fixtures.path(path)); }, function(e) { assert.strictEqual(e.code, 'MODULE_NOT_FOUND'); return true; @@ -30,5 +31,5 @@ function assertModuleNotFound(path) { } function assertExists(fixture) { - assert(common.fileExists(common.fixturesDir + fixture)); + assert(common.fileExists(fixtures.path(fixture))); }