Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

use resolve() instead of join() for --require

TJ Holowaychukdfe6f8437767
diff --git a/bin/_mocha b/bin/_mocha
index 6776b1fc..73295051 100755
--- a/bin/_mocha
+++ b/bin/_mocha
@@ -146,10 +146,8 @@ program.on('interfaces', function(){
module.paths.push(cwd, join(cwd, 'node_modules'));
program.on('require', function(mod){
- var abs = exists(mod)
- || exists(mod + '.js');
-
- if (abs) mod = join(cwd, mod);
+ var abs = exists(mod) || exists(mod + '.js');
+ if (abs) mod = resolve(mod);
require(mod);
});