Skip to content

Commit

Permalink
fix coverage issue
Browse files Browse the repository at this point in the history
  • Loading branch information
loreanvictor committed May 10, 2024
1 parent a29e4d5 commit c1c075f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/select.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit c1c075f

Please sign in to comment.