From c1c075f0ad72dbb7e0ff074e6d7d8ee480b9b2a3 Mon Sep 17 00:00:00 2001 From: Eugene Ghanizadeh Khoub Date: Fri, 10 May 2024 16:06:44 +0200 Subject: [PATCH] fix coverage issue --- src/test/select.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/select.test.ts b/src/test/select.test.ts index 044a8d4..eccd069 100644 --- a/src/test/select.test.ts +++ b/src/test/select.test.ts @@ -4,6 +4,21 @@ import { select } from '../select' describe(select, () => { + test('proxies a source.', () => { + const src = new State(0) + const selected = select(src) + + const cb = jest.fn() + + observe($ => cb($(selected)!)) + + src.set(1) + expect(cb).toHaveBeenCalledWith(1) + + src.set(2) + expect(cb).toHaveBeenCalledWith(2) + }) + test('without select, higher order sources are stopped after switch.', () => { const flag = new State(false) const a = new State('a')