diff --git a/tests/vanilla/store.test.tsx b/tests/vanilla/store.test.tsx index 9905909ea8..3ad51addc6 100644 --- a/tests/vanilla/store.test.tsx +++ b/tests/vanilla/store.test.tsx @@ -896,3 +896,15 @@ it('throws falsy errors in onMount, onUnmount, and listeners', () => { }) expect(() => store.set(c, 1)).toThrow('') }) + +it('does not update dependencies when accessed with write get', () => { + const store = createStore() + const a = atom(0) + const bRead = vi.fn((get) => get(a)) + const b = atom(bRead) + const w = atom(null, (get) => get(b)) + store.set(w) + bRead.mockClear() + store.set(a, 1) + expect(bRead).not.toHaveBeenCalled() // fails +})