From 6953c29dc59e9aff425523aa4a2fe84891a188da Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Wed, 21 May 2025 11:41:09 +0900 Subject: [PATCH] test(vanilla/shallow): add test for pure iterable with different values returns false (#3129) --- tests/vanilla/shallow.test.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/vanilla/shallow.test.tsx b/tests/vanilla/shallow.test.tsx index d82170ed..bc855534 100644 --- a/tests/vanilla/shallow.test.tsx +++ b/tests/vanilla/shallow.test.tsx @@ -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 { + yield 1 + yield 2 + }, + } + + const iterableB = { + [Symbol.iterator]: function* (): Generator { + yield 1 + yield 3 + }, + } + + expect(shallow(iterableA, iterableB)).toBe(false) + }) }) describe('unsupported cases', () => {