diff --git a/test/parallel/test-require-extensions-same-filename-as-dir.js b/test/parallel/test-require-extensions-same-filename-as-dir.js index 610b8d1ce26584..546a2cb381d508 100644 --- a/test/parallel/test-require-extensions-same-filename-as-dir.js +++ b/test/parallel/test-require-extensions-same-filename-as-dir.js @@ -22,9 +22,17 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); +const path = require('path'); -const content = require(common.fixturesDir + - '/json-with-directory-name-module/module-stub/one/two/three.js'); +const filePath = path.join( + common.fixturesDir, + 'json-with-directory-name-module', + 'module-stub', + 'one', + 'two', + 'three.js' +); +const content = require(filePath); assert.notStrictEqual(content.rocko, 'artischocko'); assert.strictEqual(content, 'hello from module-stub!');