Created
September 27, 2013 18:30
-
-
Save zippo445/6733044 to your computer and use it in GitHub Desktop.
a test for nodeunit exception handling....
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
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