Sha256: f9b836fe18ed73458b31760de7297aae2835b80cde9f2bce276ccc5285e238e6

Contents?: true

Size: 1.14 KB

Versions: 28

Compression:

Stored size: 1.14 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');
      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':
    case '--harmony-generators':
    case '--prof':
      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

28 entries across 28 versions & 1 rubygems

Version Path
stylus-source-0.42.2 vendor/node_modules/mocha/bin/mocha
stylus-source-0.42.1 vendor/node_modules/mocha/bin/mocha
stylus-source-0.42.0 vendor/node_modules/mocha/bin/mocha
stylus-source-0.41.3 vendor/node_modules/mocha/bin/mocha
stylus-source-0.41.2 vendor/node_modules/mocha/bin/mocha
stylus-source-0.41.1 vendor/node_modules/mocha/bin/mocha
stylus-source-0.41.0 vendor/node_modules/mocha/bin/mocha
stylus-source-0.40.3 vendor/node_modules/mocha/bin/mocha
stylus-source-0.40.2 vendor/node_modules/mocha/bin/mocha
stylus-source-0.40.1 vendor/node_modules/mocha/bin/mocha
stylus-source-0.40.0 vendor/node_modules/mocha/bin/mocha
stylus-source-0.39.4 vendor/node_modules/mocha/bin/mocha
stylus-source-0.39.3 vendor/node_modules/mocha/bin/mocha
stylus-source-0.39.2 vendor/node_modules/mocha/bin/mocha
stylus-source-0.39.1 vendor/node_modules/mocha/bin/mocha
stylus-source-0.39.0 vendor/node_modules/mocha/bin/mocha
stylus-source-0.38.0 vendor/node_modules/mocha/bin/mocha
stylus-source-0.37.0 vendor/node_modules/mocha/bin/mocha
stylus-source-0.36.1 vendor/node_modules/mocha/bin/mocha
stylus-source-0.36.0 vendor/node_modules/mocha/bin/mocha