diff options
| author | Jules Laplace <jules@okfoc.us> | 2012-09-24 16:22:07 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2012-09-24 16:22:07 -0400 |
| commit | 686106d544ecc3b6ffd4db2b665d3bc879a58d8c (patch) | |
| tree | a5b5e50237cef70e12f0745371896e96f5f6d578 /.bin/mocha | |
ok
Diffstat (limited to '.bin/mocha')
| -rwxr-xr-x | .bin/mocha | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/.bin/mocha b/.bin/mocha new file mode 100755 index 0000000..811ed9d --- /dev/null +++ b/.bin/mocha @@ -0,0 +1,32 @@ +#!/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': + args.unshift('--debug'); + break; + case 'debug': + case '--debug': + case '--debug-brk': + args.unshift(arg); + 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); |
