Skip to content

Commit

Permalink
refactor: remove cancel method as it no longer exists
Browse files Browse the repository at this point in the history
it wasn't doing anything in that test
  • Loading branch information
TkDodo committed Dec 28, 2021
1 parent 250c654 commit 28c9291
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/reactjs/tests/useQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4268,17 +4268,9 @@ describe('useQuery', () => {
const key = queryKey()
const states: UseQueryResult<string>[] = []

const queryFn = () => {
let cancelFn = jest.fn()

const promise = new Promise<string>((resolve, reject) => {
cancelFn = jest.fn(() => reject('Cancelled'))
sleep(50).then(() => resolve('OK'))
})

;(promise as any).cancel = cancelFn

return promise
const queryFn = async () => {
await sleep(50)
return 'OK'
}

function Page() {
Expand Down

0 comments on commit 28c9291

Please sign in to comment.