diff --git a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js index 43245e22de8b52..66a58be01c3c4a 100644 --- a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js +++ b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js @@ -23,9 +23,8 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); - -const content = require(common.fixturesDir + - '/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js'); +const filePath = '/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js'; +const content = require(`${common.fixturesDir}${filePath}`); assert.notStrictEqual(content.rocko, 'artischocko'); assert.strictEqual(content, 'hello from module-stub!');