Skip to content

Commit 6953c29

Browse files
authored
test(vanilla/shallow): add test for pure iterable with different values returns false (#3129)
1 parent 5df8085 commit 6953c29

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/vanilla/shallow.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,24 @@ describe('generators', () => {
200200
expect(Symbol.iterator in gen()).toBe(true)
201201
expect(shallow(gen(), gen())).toBe(true)
202202
})
203+
204+
it('pure iterable with different values returns false', () => {
205+
const iterableA = {
206+
[Symbol.iterator]: function* (): Generator<number> {
207+
yield 1
208+
yield 2
209+
},
210+
}
211+
212+
const iterableB = {
213+
[Symbol.iterator]: function* (): Generator<number> {
214+
yield 1
215+
yield 3
216+
},
217+
}
218+
219+
expect(shallow(iterableA, iterableB)).toBe(false)
220+
})
203221
})
204222

205223
describe('unsupported cases', () => {

0 commit comments

Comments
 (0)