Skip to content

Commit

Permalink
write an error if an EventEmitter hasn't fired
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed May 10, 2010
1 parent 06485b8 commit 6e49a11
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ function tryFinish(remaining) {
}
}

//
// On exit, check that all promises have been fired.
// If not, print an error message.
//
process.addListener('exit', function () {
if (honored + broken + errored < total) {
sys.puts('\n* ' + stylize("An EventEmitter has failed to fire.", 'red'));
}
});

//
// Wrap a Node.js style async function into an EventEmmitter
//
Expand Down

0 comments on commit 6e49a11

Please sign in to comment.