I'm hoping to find some help with this problem. I'm trying to write tests for an application I am writing. I have distilled the problem in to the following sample code. I want to test that an error was thrown. I'm using Testacular as a test runner with mocha as the framework and chai as the assertion library. The tests run, but the test fails because an error was thrown! Any help is greatly appreciated!
function iThrowError() {
throw new Error("Error thrown");
}
var assert = chai.assert,
expect = chai.expect;
describe('The app', function() {
describe('this feature', function() {
it("is a function", function(){
assert.throw(iThrowError(), Error, "Error thrown");
});
});
});