Sha256: 7bbfaab59eb462e83317accf82b8f09a5f486387471129be7be59f1c6de16504
Contents?: true
Size: 1.54 KB
Versions: 1
Compression:
Stored size: 1.54 KB
Contents
#!/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){ var flag = arg.split('=')[0]; switch (flag) { case '-d': args.unshift('--debug'); args.push('--no-timeouts'); break; case 'debug': case '--debug': case '--debug-brk': args.unshift(arg); args.push('--no-timeouts'); break; case '-gc': case '--expose-gc': args.unshift('--expose-gc'); break; case '--gc-global': case '--harmony': case '--harmony-proxies': case '--harmony-collections': case '--harmony-generators': case '--no-deprecation': case '--prof': case '--throw-deprecation': case '--trace-deprecation': args.unshift(arg); break; default: if (0 == arg.indexOf('--trace')) args.unshift(arg); else args.push(arg); break; } }); var proc = spawn(process.argv[0], args, { stdio: 'inherit' }); proc.on('exit', function (code, signal) { process.on('exit', function(){ if (signal) { process.kill(process.pid, signal); } else { process.exit(code); } }); }); // terminate children. process.on('SIGINT', function () { proc.kill('SIGINT'); // calls runner.abort() proc.kill('SIGTERM'); // if that didn't work, we're probably in an infinite loop, so make it die. process.kill(process.pid, 'SIGINT'); });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
stylus-source-0.49.3 | vendor/node_modules/mocha/bin/mocha |