diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2017-10-25 12:36:24 +0200 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-10-25 10:45:36 -0700 |
commit | 8a00f1d129ac5fcbbce8e115a2576e0ea080e4ed (patch) | |
tree | 4d48078208e86455f6bdb0129c89073b9aeaef1e /test/parallel | |
parent | 8172f4547e7e2a7e1b7363e1cb9d7431fad241ff (diff) | |
download | node-new-8a00f1d129ac5fcbbce8e115a2576e0ea080e4ed.tar.gz |
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: https://github.com/nodejs/node/pull/16486
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>>
Reviewed-By: Anna Henningsen <anna@addaleax.net>>
Reviewed-By: James M Snell <jasnell@gmail.com>>
Diffstat (limited to 'test/parallel')
-rw-r--r-- | test/parallel/test-require-resolve.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/parallel/test-require-resolve.js b/test/parallel/test-require-resolve.js index c0595ba916..6f2253a4e2 100644 --- a/test/parallel/test-require-resolve.js +++ b/test/parallel/test-require-resolve.js @@ -32,7 +32,7 @@ assert.strictEqual( require.resolve(fixtures.path('a')).toLowerCase()); assert.strictEqual( fixtures.path('nested-index', 'one', 'index.js').toLowerCase(), - require.resolve(fixtures.path('nested-index', 'one').toLowerCase())); + require.resolve(fixtures.path('nested-index', 'one')).toLowerCase()); assert.strictEqual('path', require.resolve('path')); // Test configurable resolve() paths. |