2019-01-30 22:47:03 +07:00
|
|
|
#!/usr/bin/env node
|
2019-01-27 21:54:29 +07:00
|
|
|
|
2019-01-30 22:47:03 +07:00
|
|
|
var program = require('commander');
|
|
|
|
var spawn = require('child_process').spawn;
|
|
|
|
|
|
|
|
program
|
|
|
|
.option('--with-server', 'Spawn Authelia before running the tests.')
|
|
|
|
.parse(process.argv);
|
|
|
|
|
|
|
|
mocha = spawn('./node_modules/.bin/mocha', ['--exit', '--colors', '--require', 'ts-node/register', ...program.args], {
|
|
|
|
env: {
|
|
|
|
...process.env,
|
|
|
|
TS_NODE_PROJECT: 'test/tsconfig.json',
|
|
|
|
WITH_SERVER: (program.withServer) ? 'y' : 'n',
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
mocha.stdout.on('data', (data) => {
|
|
|
|
process.stdout.write(`${data}`);
|
|
|
|
});
|
|
|
|
|
|
|
|
mocha.stderr.on('data', (data) => {
|
|
|
|
process.stderr.write(`${data}`);
|
|
|
|
});
|
|
|
|
// TS_NODE_PROJECT=server/tsconfig.json ./node_modules/.bin/mocha --colors --require ts-node/register server/src/**/*.spec.ts
|