Skip to content
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
da463ca
test(react-query/useQuery.promise): unskip 'cancelQueries' while susp…
sukvvon Jun 10, 2026
053a7af
test(react-query/useQuery.promise): clarify why 'sleep' is extended i…
sukvvon Jun 10, 2026
6eea5cd
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 11, 2026
9f788de
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 11, 2026
aeaed7b
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
ef2e056
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
5a3c5ee
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
082a48e
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
5025364
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
6c44d7a
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
6210613
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
8ab3239
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
aa5d1a3
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 14, 2026
5b7b6c9
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 27, 2026
e111c28
Merge branch 'main' into test/react-query-unskip-cancel-queries-while…
sukvvon Jun 28, 2026
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
14 changes: 8 additions & 6 deletions packages/react-query/src/__tests__/useQuery.promise.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -788,14 +788,16 @@ describe('useQuery().promise', { timeout: 10_000 }, () => {
expect(queryFn).toHaveBeenCalledOnce()
})

it.skip('should stay pending when canceled with cancelQueries while suspending until refetched', async () => {
it('should stay pending when canceled with cancelQueries while suspending until refetched', async () => {
const renderStream = createRenderStream({ snapshotDOM: true })
const key = queryKey()
let count = 0
const queryFn = vi.fn().mockImplementation(async () => {
await sleep(10)
return 'test' + count++
})
// `sleep` is longer than usual on purpose: with `shouldAdvanceTime`, the
// real time spent rendering and awaiting `takeRender` (~40ms) is added to
// the fake clock, so a shorter fetch would resolve before `cancel` can take
// effect. A longer fetch keeps the query in-flight when it is cancelled.
const queryFn = vi
.fn()
.mockImplementation(() => sleep(50).then(() => 'test'))

const options = {
queryKey: key,
Expand Down
Loading