Merge branch 'tobe-tostring' of https://github.com/johnjbarton/jasmine into johnjbarton-tobe-tostring

- Merges #1718 from @johnjbarton
- Fixes #1726
This commit is contained in:
Gregg Van Hove
2019-08-07 12:01:26 -07:00
3 changed files with 172 additions and 15 deletions
+8 -2
View File
@@ -457,11 +457,17 @@ describe('jasmineUnderTest.pp', function() {
// Valid: an actual number
baz: 3,
// Valid: an actual Error object
qux: new Error('bar')
qux: new Error('bar'),
//
baddy: {
toString: function() {
throw new Error('I am a bad toString');
}
}
};
expect(jasmineUnderTest.pp(obj)).toEqual(
'Object({ foo: [object Number], bar: [object Object], baz: 3, qux: Error: bar })'
'Object({ foo: [object Number], bar: [object Object], baz: 3, qux: Error: bar, baddy: has-invalid-toString-method })'
);
});
});