MatchersUtil#contains uses deep equality rather than === for set members

[#169001712]
This commit is contained in:
Steve Gravrock
2021-07-24 14:23:05 -07:00
parent 0170005015
commit c73df57720
5 changed files with 106 additions and 20 deletions

View File

@@ -109,6 +109,28 @@ describe('base helpers', function() {
});
});
describe('isIterable_', function() {
it('returns true when the object is an Array', function() {
expect(jasmineUnderTest.isIterable_([])).toBe(true);
});
it('returns true when the object is a Set', function() {
expect(jasmineUnderTest.isIterable_(new Set())).toBe(true);
});
it('returns true when the object is a Map', function() {
expect(jasmineUnderTest.isIterable_(new Map())).toBe(true);
});
it('returns true when the object implements @@iterator', function() {
const myIterable = { [Symbol.iterator]: function() {} };
expect(jasmineUnderTest.isIterable_(myIterable)).toBe(true);
});
it('returns false when the object does not implement @@iterator', function() {
expect(jasmineUnderTest.isIterable_({})).toBe(false);
});
});
describe('isPending_', function() {
it('returns a promise that resolves to true when the promise is pending', function() {
var promise = new Promise(function() {});