Skip to content

Commit 6e49a11

Browse files
author
cloudhead
committed
write an error if an EventEmitter hasn't fired
1 parent 06485b8 commit 6e49a11

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/vows.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ function tryFinish(remaining) {
162162
}
163163
}
164164

165+
//
166+
// On exit, check that all promises have been fired.
167+
// If not, print an error message.
168+
//
169+
process.addListener('exit', function () {
170+
if (honored + broken + errored < total) {
171+
sys.puts('\n* ' + stylize("An EventEmitter has failed to fire.", 'red'));
172+
}
173+
});
174+
165175
//
166176
// Wrap a Node.js style async function into an EventEmmitter
167177
//

0 commit comments

Comments
 (0)