diff --git a/spec/core/ExceptionFormatterSpec.js b/spec/core/ExceptionFormatterSpec.js index 0e4f074c..e896a5fe 100644 --- a/spec/core/ExceptionFormatterSpec.js +++ b/spec/core/ExceptionFormatterSpec.js @@ -124,18 +124,7 @@ describe("ExceptionFormatter", function() { var result = new jasmineUnderTest.ExceptionFormatter().stack(error); - expect(result).toMatch(/error properties: {/); - expect(result).toMatch(/"someProperty": "hello there"/); - }); - - it("drops error properties if there is a cycle", function() { - var error; - try { throw new Error("an error") } catch(e) { error = e; } - error.someProperty = error; - - var result = new jasmineUnderTest.ExceptionFormatter().stack(error); - - expect(result).not.toMatch(/error properties/); + expect(result).toMatch(/error properties:.*someProperty.*hello there/); }); }); diff --git a/src/core/ExceptionFormatter.js b/src/core/ExceptionFormatter.js index 71961776..aa3a62ae 100644 --- a/src/core/ExceptionFormatter.js +++ b/src/core/ExceptionFormatter.js @@ -74,9 +74,7 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) { } if (!empty) { - try { - return 'error properties: ' + JSON.stringify(result, null, 2) + '\n'; - } catch (_) {} + return 'error properties: ' + j$.pp(result) + '\n'; } return '';