Skip to content

Commit 9f87d6a

Browse files
danbevcjihrig
authored andcommitted
test: call toLowerCase on the resolved module
The commit updates test-require-resolve.js to call toLowerCase on the resolved module instead of the path. Currently this test will fail if the path to where node exists contains uppercase letters. For example: ``` $ out/Release/node test/parallel/test-require-resolve.js /root/rpmbuild/BUILD/node-v8.8.0/test/parallel module.js:515 throw err; ^ Error: Cannot find module '/root/rpmbuild/build/node-v8.8.0/test/fixtures/nested-index/one' at Function.Module._resolveFilename (module.js:513:15) at Function.resolve (internal/module.js:18:19) at Object.<anonymous> (/root/rpmbuild/BUILD/node-v8.8.0/test/parallel/test-require-resolve.js:37:11) at Module._compile (module.js:612:30) at Object.Module._extensions..js (module.js:623:10) at Module.load (module.js:531:32) at tryModuleLoad (module.js:494:12) at Function.Module._load (module.js:486:3) at Function.Module.runMain (module.js:653:10) at startup (bootstrap_node.js:187:16) ``` PR-URL: #16486 Reviewed-By: Luigi Pinca <[email protected]>> Reviewed-By: Ben Noordhuis <[email protected]>> Reviewed-By: Colin Ihrig <[email protected]>> Reviewed-By: Anna Henningsen <[email protected]>> Reviewed-By: James M Snell <[email protected]>>
1 parent ef0551f commit 9f87d6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-require-resolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ assert.strictEqual(
3232
require.resolve(fixtures.path('a')).toLowerCase());
3333
assert.strictEqual(
3434
fixtures.path('nested-index', 'one', 'index.js').toLowerCase(),
35-
require.resolve(fixtures.path('nested-index', 'one').toLowerCase()));
35+
require.resolve(fixtures.path('nested-index', 'one')).toLowerCase());
3636
assert.strictEqual('path', require.resolve('path'));
3737

3838
console.log('ok');

0 commit comments

Comments
 (0)