From 963b1cca22158b961b390ddd60e28fe307838c06 Mon Sep 17 00:00:00 2001 From: Nito Buendia Date: Thu, 13 Sep 2018 19:48:10 +0800 Subject: [PATCH] Add tests for new unnamed errors. --- spec/core/ExceptionFormatterSpec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/core/ExceptionFormatterSpec.js b/spec/core/ExceptionFormatterSpec.js index 95a476b0..8596f6b9 100644 --- a/spec/core/ExceptionFormatterSpec.js +++ b/spec/core/ExceptionFormatterSpec.js @@ -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(),