Add tests for new unnamed errors.

This commit is contained in:
Nito Buendia
2018-09-13 19:48:10 +08:00
parent d4f9b41eda
commit 963b1cca22

View File

@@ -37,6 +37,15 @@ describe("ExceptionFormatter", function() {
expect(message).toEqual('A Classic Mistake: you got your foo in my bar');
});
it('formats thrown exceptions with message but no name', function() {
var unnamedError = {message: 'This is an unnamed error message.'};
exceptionFormatter = new jasmineUnderTest.ExceptionFormatter(),
message = exceptionFormatter.message(unnamedError);
expect(message).toEqual('This is an unnamed error message.');
});
it("formats thrown exceptions that aren't errors", function() {
var thrown = "crazy error",
exceptionFormatter = new jasmineUnderTest.ExceptionFormatter(),