mirror of https://github.com/lukechilds/node.git
isaacs
14 years ago
committed by
Ryan Dahl
9 changed files with 89 additions and 3 deletions
@ -0,0 +1,3 @@ |
|||||
|
console.error(__filename); |
||||
|
console.error(module.paths.join('\n')+'\n'); |
||||
|
throw new Error('Should not ever get here.'); |
@ -0,0 +1,2 @@ |
|||||
|
console.error(__filename); |
||||
|
console.error(module.paths.join('\n')+'\n'); |
@ -0,0 +1,13 @@ |
|||||
|
console.error(__filename); |
||||
|
console.error(module.paths.join('\n')+'\n'); |
||||
|
// this should work, and get the one that doesn't throw
|
||||
|
require('bar'); |
||||
|
|
||||
|
// since this is inside a node_modules folder,
|
||||
|
// it should be impossible to ever see /node_modules in the
|
||||
|
// lookup paths, since it's rooted on the uppermost node_modules
|
||||
|
// directory.
|
||||
|
require('assert').equal(-1, module.paths.indexOf('/node_modules')); |
||||
|
|
||||
|
// this should work, and get the one in ./node_modules/asdf.js
|
||||
|
require('asdf'); |
@ -0,0 +1,2 @@ |
|||||
|
console.error(__filename); |
||||
|
console.error(module.paths.join('\n')+'\n'); |
@ -0,0 +1,3 @@ |
|||||
|
console.error(__filename); |
||||
|
console.error(module.paths.join('\n')+'\n'); |
||||
|
require('baz'); |
@ -0,0 +1,3 @@ |
|||||
|
console.error(__filename); |
||||
|
console.error(module.paths.join('\n')+'\n'); |
||||
|
throw new Error('Should not ever get here.'); |
Loading…
Reference in new issue