Skip to content

Commit

Permalink
Test wrapper
Browse files Browse the repository at this point in the history
The tests run in a container, and we need to fowrard the exit code
if the tests fail
  • Loading branch information
esatterwhite committed Dec 29, 2016
1 parent 4fe51ce commit 0386397
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var child_process = require('child_process')
, fs = require('fs')
, util = require("util")
, production = (process.env.NODE_ENV === 'test')
, html
, reporter
, coverage
, mocha
, env
;

env = Object.assign({}, process.env );
env.MOCHA_COLORS = 1;
reporter = process.stdout;
mocha = child_process.spawn("mocha", [
"--recursive"
, '--reporter=spec'
, 'test/*.spec.js'
],{env:env})
mocha.on('exit', function( code ){
process.exit( code );
})
mocha.stdout.pipe( reporter );
mocha.stderr.pipe( reporter );

0 comments on commit 0386397

Please sign in to comment.