Skip to content

Commit

Permalink
test(reactive): optimize box test case (#1866)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zardddddd60 authored Jul 23, 2021
1 parent f98129a commit 4e191e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/reactive/src/__tests__/annotations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ test('box annotation', () => {
reaction(() => {
handler(obs.get())
})
obs.set(333)
expect(handler).toBeCalledWith(123)
expect(handler).toBeCalledWith(123)
const boxValue = 333
obs.set(boxValue)
expect(handler1).toBeCalledTimes(1)
expect(handler1.mock.calls[0][0]).toMatchObject({
value: boxValue,
})
expect(handler).toBeCalledTimes(2)
expect(handler.mock.calls[0][0]).toBe(123)
expect(handler.mock.calls[1][0]).toBe(boxValue)
})

test('ref annotation', () => {
Expand Down

0 comments on commit 4e191e0

Please sign in to comment.