Merge branch 'print_exception_properties' of https://github.com/jbunton-atlassian/jasmine into jbunton-atlassian-print_exception_properties

- Merges #1516 from @jbunton-atlassian
This commit is contained in:
Gregg Van Hove
2018-02-26 17:47:39 -08:00
3 changed files with 69 additions and 2 deletions

View File

@@ -116,5 +116,16 @@ describe("ExceptionFormatter", function() {
it("returns null if no Error provided", function() {
expect(new jasmineUnderTest.ExceptionFormatter().stack()).toBeNull();
});
it("includes error properties in stack", function() {
var error;
try { throw new Error("an error") } catch(e) { error = e; }
error.someProperty = 'hello there';
var result = new jasmineUnderTest.ExceptionFormatter().stack(error);
expect(result).toMatch(/error properties:.*someProperty.*hello there/);
});
});
});