mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
test(vanilla/shallow): add test for pure iterable with different values returns false (#3129)
This commit is contained in:
parent
5df8085b0b
commit
6953c29dc5
@ -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', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user