Skip to content

Instantly share code, notes, and snippets.

@koichik
Created November 1, 2011 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koichik/1330016 to your computer and use it in GitHub Desktop.
Save koichik/1330016 to your computer and use it in GitHub Desktop.
test for 4d4900f
var assert = require('assert');
var N = 2;
var tickCount = 0;
var exceptionCount = 0;
function cb() {
++tickCount;
throw new Error();
}
for (var i = 0; i < N; ++i) {
process.nextTick(cb);
}
process.on('uncaughtException', function() {
++exceptionCount;
});
process.on('exit', function() {
process.removeAllListeners('uncaughtException');
assert.equal(tickCount, N);
assert.equal(exceptionCount, N);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment