Merge branch 'promise-matching-1314' of https://github.com/sderickson/jasmine

This commit is contained in:
Steve Gravrock
2017-11-02 17:17:05 -07:00
4 changed files with 30 additions and 0 deletions

View File

@@ -166,6 +166,16 @@ describe("matchersUtil", function() {
expect(jasmineUnderTest.matchersUtil.equals(a,b)).toBe(true);
});
it("passes for equivalent Promises (GitHub issue #1314)", function() {
if (typeof Promise === 'undefined') { return; }
var p1 = new Promise(function () {}),
p2 = new Promise(function () {});
expect(jasmineUnderTest.matchersUtil.equals(p1, p1)).toBe(true);
expect(jasmineUnderTest.matchersUtil.equals(p1, p2)).toBe(false);
});
describe("when running in a browser", function() {
function isNotRunningInBrowser() {