Skip to content

Commit 7c07b67

Browse files
committed
Change mocha require path
Currently in node 6 (RC2) the `require('../')` breaks with the below error: ``` module.js:128 for (var i = 0; i < exts.length; i++) { ^ TypeError: Cannot read property 'length' of undefined at tryExtensions (module.js:128:27) at tryPackage (module.js:107:10) at Function.Module._findPath (module.js:182:18) at Function.Module._resolveFilename (module.js:434:25) at Function.Module._load (module.js:384:25) at Module.require (module.js:464:17) at require (internal/module.js:16:19) at Object.<anonymous> (/Users/XXXX/Documents/Personal/Projects/XXXXX/node_modules/mocha/bin/_mocha:12:11) at Module._compile (module.js:539:32) at Object.Module._extensions..js (module.js:548:10) ``` Changing to `require('./../lib/mocha')` resolves the issue.
1 parent caee94f commit 7c07b67

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bin/_mocha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var program = require('commander'),
99
fs = require('fs'),
1010
resolve = path.resolve,
1111
exists = fs.existsSync || path.existsSync,
12-
Mocha = require('../'),
12+
Mocha = require('./../lib/mocha'),
1313
utils = Mocha.utils,
1414
join = path.join,
1515
cwd = process.cwd(),

0 commit comments

Comments
 (0)