Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Jan 6, 2025
1 parent 77c767f commit 1aefaed
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions packages/query-core/src/__tests__/queryObserver.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1171,36 +1171,6 @@ describe('queryObserver', () => {
unsubscribe()
})

test('getOptimisticResult() should return pending on previously errored queries', async () => {
const key = queryKey()

await queryClient.prefetchQuery({
queryKey: key,
queryFn: () => {
throw new Error('test')
},
retry: false,
})

const options = queryClient.defaultQueryOptions({
queryKey: key,
queryFn: async () => {
await sleep(1)
return 'data'
},
enabled: false,
})

const observer = new QueryObserver(queryClient, options)

const optimisticResult = observer.getOptimisticResult(options)

const fetched = await queryClient.fetchQuery(options)

expect(fetched).toBe('data')
expect(optimisticResult.status).toBe('pending')
})

test('should return a new promise after recovering from an error', async () => {
const results: Array<QueryObserverResult> = []
const key = queryKey()
Expand Down

0 comments on commit 1aefaed

Please sign in to comment.