describe('toThrow', function() { it('checks that the expected exception was thrown by the actual', function() { var object = { doSomething: function() { throw new Error("Unexpected error!") } }; expect(object.doSomething).toThrow(new Error("Unexpected error!")); }); }); execJasmine();