ButlerBin/node_modules/mocha/bin/mocha

29 lines
629 B
JavaScript
Executable File

#!/usr/bin/env node
/**
* This tiny wrapper file checks for known node flags and appends them
* when found, before invoking the "real" _mocha(1) executable.
*/
var spawn = require('child_process').spawn
, args = [ __dirname + '/_mocha' ];
process.argv.slice(2).forEach(function (arg) {
switch (arg) {
case '-d':
case '--debug':
args.unshift('debug');
break;
case '-gc':
case '--expose-gc':
args.unshift('--expose-gc');
break;
default:
args.push(arg);
break;
}
});
var proc = spawn(process.argv[0], args, { customFds: [0,1,2] });
proc.on('exit', process.exit);