#!/usr/bin/env node { 'use strict'; const TestRunner = require('../src/TestRunner'); const path = require('path'); const log = require('ee-log'); // handle unhandleed rejections process.on('unhandledRejection', (reason, p) => { console.log(reason); }); // make sure structured stacktraces are returned Error.prepareStackTrace = (e, stack) => { // rxjs is messing with the stack, give // it something to work on stack.split = (...args) => { return stack.map(frame => frame.toString()).join('\n').split(...args); } return stack; }; process.on('uncaughtException', (err) => { console.log(err.message); err.stack.forEach(frame => console.log(frame.toString())); }); let files = process.argv.slice(2).filter(s => s && s[0] !== '-'); files = files.map((file) => { if (file[0] === '.') { return path.join(process.env.PWD, file) } return file; }); // executes as binary, run tests new TestRunner({ patterns: files }).execute(); }