Skip to content

Commit c1c075f

Browse files
committed
fix coverage issue
1 parent a29e4d5 commit c1c075f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: src/test/select.test.ts

+15
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ import { select } from '../select'
44

55

66
describe(select, () => {
7+
test('proxies a source.', () => {
8+
const src = new State(0)
9+
const selected = select(src)
10+
11+
const cb = jest.fn()
12+
13+
observe($ => cb($(selected)!))
14+
15+
src.set(1)
16+
expect(cb).toHaveBeenCalledWith(1)
17+
18+
src.set(2)
19+
expect(cb).toHaveBeenCalledWith(2)
20+
})
21+
722
test('without select, higher order sources are stopped after switch.', () => {
823
const flag = new State(false)
924
const a = new State('a')

0 commit comments

Comments
 (0)