Skip to content

Commit

Permalink
test: fetches the first time even without refetchOnMount
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 14, 2024
1 parent 4eebfd3 commit 7e54b65
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/use-query.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ describe('useQuery', () => {
await flushPromises()
expect(wrapper.vm.error).toEqual(new Error('foo'))
})

it('fetches the first time with refetchOnMount false', async () => {
const { query } = mountSimple({ refetchOnMount: false })

await flushPromises()
expect(query).toHaveBeenCalledTimes(1)
})
})

describe('staleTime', () => {
Expand Down

0 comments on commit 7e54b65

Please sign in to comment.