Skip to content

Commit

Permalink
fix(tests): fix prefechQuery test
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jun 18, 2020
1 parent 26844a9 commit 2134f49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tests/queryCache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ describe('queryCache', () => {
expect(second).toBe(first)
})

test('prefetchQuery should force fetch', async () => {
queryCache.setQueryData('key', 'stale')
const fetchFn = () => Promise.resolve('fresh')
test('prefetchQuery should not force fetch', async () => {
queryCache.setQueryData('key', 'og')
const fetchFn = () => Promise.resolve('new')
const first = await queryCache.prefetchQuery(
'key',
fetchFn,
Expand All @@ -44,7 +44,7 @@ describe('queryCache', () => {
throwOnError: true,
}
)
expect(first).toBe('fresh')
expect(first).toBe('og')
})

test('prefetchQuery should throw error when throwOnError is true', async () => {
Expand Down

0 comments on commit 2134f49

Please sign in to comment.