Merge branch 'pretty-print-cross-frame-objects' of https://github.com/thatfulvioguy/jasmine into thatfulvioguy-pretty-print-cross-frame-objects

- Merges #1091 from @thatfulvioguy
- Fixes #1087
This commit is contained in:
Gregg Van Hove
2016-09-27 11:39:15 -07:00
3 changed files with 23 additions and 2 deletions

View File

@@ -187,6 +187,15 @@ describe("jasmineUnderTest.pp", function () {
};
expect(jasmineUnderTest.pp(obj)).toEqual("my toString");
// Simulate object from another global context (e.g. an iframe or Web Worker) that does not actually have a custom
// toString despite obj.toString !== Object.prototype.toString
var objFromOtherContext = {
foo: 'bar',
toString: function () { return Object.prototype.toString.call(this); }
};
expect(jasmineUnderTest.pp(objFromOtherContext)).toEqual("Object({ foo: 'bar', toString: Function })");
});
it("should stringify objects from anonymous constructors with custom toString", function () {