From cfa33c2b079f669f78ffff748b4980e43940114c Mon Sep 17 00:00:00 2001 From: tejbirsingh Date: Fri, 6 Oct 2017 09:59:04 -0700 Subject: [PATCH 1/2] test: replacing common.fixturesDir in test-require-exceptions.js Using common.fixtures module instead of common.fixturesDir based on task at Nodejs code and learn at Node.js Interactive 2017 in Vancouver. --- 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 57d0e9c218e206..8f6b8e9d0976c4 100644 --- a/test/parallel/test-require-exceptions.js +++ b/test/parallel/test-require-exceptions.js @@ -22,15 +22,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 @@ -43,7 +44,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; @@ -51,5 +52,5 @@ function assertModuleNotFound(path) { } function assertExists(fixture) { - assert(common.fileExists(common.fixturesDir + fixture)); + assert(common.fileExists(fixtures.path(fixture))); } From 085b28fa35566c783c043037c9859afdf9dd9d98 Mon Sep 17 00:00:00 2001 From: tejbirsingh Date: Sun, 15 Oct 2017 18:45:45 -0700 Subject: [PATCH 2/2] test: removing space after require in test-require-exceptions.js Removing space after require to appease linter. --- test/parallel/test-require-exceptions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-require-exceptions.js b/test/parallel/test-require-exceptions.js index 8f6b8e9d0976c4..39298d3ec49987 100644 --- a/test/parallel/test-require-exceptions.js +++ b/test/parallel/test-require-exceptions.js @@ -22,7 +22,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const fixtures = require ('../common/fixtures'); +const fixtures = require('../common/fixtures'); // A module with an error in it should throw assert.throws(function() {