Created
November 1, 2011 05:48
-
-
Save koichik/1330016 to your computer and use it in GitHub Desktop.
test for 4d4900f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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