Skip to content

Commit

Permalink
Added support to --require files relative to the CWD. Closes #241
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Feb 3, 2012
1 parent 11ff9f0 commit 4a07518
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/_mocha
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ program.on('interfaces', function(){
module.paths.push(cwd, join(cwd, 'node_modules'));

program.on('require', function(mod){
var abs = path.existsSync(mod)
|| path.existsSync(mod + '.js');

if (abs) mod = join(cwd, mod);
require(mod);
});

Expand Down

0 comments on commit 4a07518

Please sign in to comment.