Sha256: fbd3edd384bfc1defb4be70ff26751364bbb653b156c33f0a4f6be260cf8ec24

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 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) {
  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;
    case '--gc-global':
    case '--harmony':
    case '--harmony-proxies':
    case '--harmony-collections':
      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, { customFds: [0,1,2] });
proc.on('exit', function (code, signal) {
  process.on('exit', function(){
    if (signal) {
      process.kill(process.pid, signal);
    } else {
      process.exit(code);
    }
  });
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stylus-source-0.31.0 vendor/node_modules/mocha/bin/mocha
stylus-source-0.30.1 vendor/node_modules/mocha/bin/mocha
stylus-source-0.30.0 vendor/node_modules/mocha/bin/mocha