Add Promise checking to eq

Fixes #1314
This commit is contained in:
Scott Erickson
2017-06-26 19:10:19 -07:00
parent 6aa069d586
commit 6ddf64568e
3 changed files with 20 additions and 0 deletions
+10
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() {