Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
const queryClient = new QueryClient()
setQueryClientContext(queryClient)
const mutation = createMutation({ mutationFn: mutationFn })
const mutation = createMutation({ mutationFn })
</script>

<button on:click={() => $mutation.mutate({ count: ++$count })}>Mutate</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@ describe('createMutation', () => {
expect(rendered.queryByText('Count: 3')).toBeInTheDocument()

expect(onSuccessMock).toHaveBeenCalledTimes(3)

expect(onSuccessMock).toHaveBeenCalledWith(1)
expect(onSuccessMock).toHaveBeenCalledWith(2)
expect(onSuccessMock).toHaveBeenCalledWith(3)
expect(onSuccessMock).toHaveBeenNthCalledWith(1, 1)
expect(onSuccessMock).toHaveBeenNthCalledWith(2, 2)
expect(onSuccessMock).toHaveBeenNthCalledWith(3, 3)

expect(onSettledMock).toHaveBeenCalledTimes(3)

expect(onSettledMock).toHaveBeenCalledWith(1)
expect(onSettledMock).toHaveBeenCalledWith(2)
expect(onSettledMock).toHaveBeenCalledWith(3)
expect(onSettledMock).toHaveBeenNthCalledWith(1, 1)
expect(onSettledMock).toHaveBeenNthCalledWith(2, 2)
expect(onSettledMock).toHaveBeenNthCalledWith(3, 3)
})

test('Set correct values for `failureReason` and `failureCount` on multiple mutate calls', async () => {
Expand Down
Loading