Skip to content

Instantly share code, notes, and snippets.

@zippo445
Created September 27, 2013 18:30
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 zippo445/6733044 to your computer and use it in GitHub Desktop.
Save zippo445/6733044 to your computer and use it in GitHub Desktop.
a test for nodeunit exception handling....
exports.testExceptionHandling = function (test){
function testfn (test){
throw Error ('This is an exception!!!');
}
nodeunit.runTest('testname', testfn, {
log: function (assertion) {
test.ok(true, 'We should have a logging call since an exception was thrown');
},
testDone: function (name, assertions) {
test.ok(assertions.failures(), "We should have failures since an exception was thrown");
test.done();
}
}, function () {});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment