Skip to content

Commit

Permalink
Merge 86a898f into 6c241fa
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed Apr 25, 2016
2 parents 6c241fa + 86a898f commit 857d91c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions bin/macaca-client
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ function init(error, data) {
process.exit('process exited with code ' + code);
});

bootstrap.on('exit', function(code) {
process.exit(code);
});

bootstrap.on('message', function(e) {
switch (e.signal) {
case 'kill':
Expand Down
3 changes: 2 additions & 1 deletion bin/macaca-client-run
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ runner.on('error', function(err) {
logger.warn(err);
});

runner.on('close', function() {
runner.on('close', function(code, signal) {
if (chunks) {
try {
var body = convert.toHtml(chunks.join(EOL));
Expand Down Expand Up @@ -130,4 +130,5 @@ runner.on('close', function() {
}
}
logger.info('Test completed!');
process.exit(code);
});
13 changes: 4 additions & 9 deletions lib/run/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,12 @@ Runner.prototype.initMocha = function() {
this.emit('data', data);
});

mocha.on('error', data => {
this.emit('error', data);
mocha.on('error', err => {
this.emit('error', err);
});

mocha.on('close', data => {
this.emit('close', data);
if (!this.options.always) {
process.send({
signal: 'kill'
});
}
mocha.on('close', (code, signal) => {
this.emit('close', code, signal);
});

this.mocha = mocha;
Expand Down

0 comments on commit 857d91c

Please sign in to comment.