test(vanilla/shallow): add test for pure iterable with different values returns false (#3129)

This commit is contained in:
Wonsuk Choi 2025-05-21 11:41:09 +09:00 committed by GitHub
parent 5df8085b0b
commit 6953c29dc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -200,6 +200,24 @@ describe('generators', () => {
expect(Symbol.iterator in gen()).toBe(true)
expect(shallow(gen(), gen())).toBe(true)
})
it('pure iterable with different values returns false', () => {
const iterableA = {
[Symbol.iterator]: function* (): Generator<number> {
yield 1
yield 2
},
}
const iterableB = {
[Symbol.iterator]: function* (): Generator<number> {
yield 1
yield 3
},
}
expect(shallow(iterableA, iterableB)).toBe(false)
})
})
describe('unsupported cases', () => {