summaryrefslogtreecommitdiff
path: root/test/parallel/test-require-resolve.js
AgeCommit message (Collapse)Author
2018-10-15test: fix arguments ordering for assertions to match the docsLiran Tal
PR-URL: https://github.com/nodejs/node/pull/23575 Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-01-29module: validate request in require.resolve.pathsJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18359 Fixes: https://github.com/nodejs/node/issues/18352 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-01-29module: validate request in require.resolveJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18359 Fixes: https://github.com/nodejs/node/issues/18352 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-21module: replace default paths in require.resolve()cjihrig
Prior to this commit, the default search paths would be included in the require.resolve() process, even if user specified paths were provided. This commit causes the default paths to be omitted by using a fake parent module. Refs: https://github.com/nodejs/node/issues/5963 PR-URL: https://github.com/nodejs/node/pull/17113 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-25test: call toLowerCase on the resolved moduleDaniel Bevenius
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>>
2017-10-25module: support custom paths to require.resolve()cjihrig
This commit allows custom lookup paths to be passed to require.resolve(). It also adds require.resolve.paths() which retrieves the default resolution paths. Fixes: https://github.com/nodejs/node/issues/5963 Fixes: https://github.com/nodejs/node/issues/16389 PR-URL: https://github.com/nodejs/node/pull/16397 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-14test: fix regression in test-require-resolver.jsTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/16192 Refs: https://github.com/nodejs/node/pull/15984 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-10-13test: use fixtures.path instead of fixturesDirMatthew Meyer
Updated parallel/test-require-resolve.js to use the fixtures module. PR-URL: https://github.com/nodejs/node/pull/15984 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-07-27test: adjust indentation for stricter lintingRich Trott
ESLint 4.x has stricter linting than previous versions. We are currently using the legacy indentation rules in the test directory. This commit changes the indentation of files to comply with the stricter 4.x linting and enable stricter linting in the test directory. PR-URL: https://github.com/nodejs/node/pull/14431 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2016-12-05test: refactor test-require-resolveblugavere
* var => const * assert.equal() => assert.strictEqual() PR-URL: https://github.com/nodejs/node/pull/10120 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2015-05-19test: enable linting for testsRoman Reiss
Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-12Remove excessive copyright/license boilerplateisaacs
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
2014-12-17test: split test in parallel/sequentialFedor Indutny
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139