test(lit-query): create 'queryClient' in 'beforeEach' and drop unneed… · TanStack/query@66a7103 · GitHub
Skip to content

Commit 66a7103

Browse files
authored
test(lit-query): create 'queryClient' in 'beforeEach' and drop unneeded 'retry: false' default options (#11677)
1 parent 0c40a4b commit 66a7103

9 files changed

Lines changed: 233 additions & 729 deletions

‎packages/lit-query/src/tests/base-controller.test.ts‎

Lines changed: 5 additions & 2 deletions

‎packages/lit-query/src/tests/client-switch-controllers.test.ts‎

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,8 @@ describe('LQ-003 client-switch coverage across controllers', () => {
176176
})
177177

178178
it('should switch queries controller to new provider client while connected', async () => {
179-
const clientA = new QueryClient({
180-
defaultOptions: {
181-
queries: {
182-
retry: false,
183-
},
184-
},
185-
})
186-
const clientB = new QueryClient({
187-
defaultOptions: {
188-
queries: {
189-
retry: false,
190-
},
191-
},
192-
})
179+
const clientA = new QueryClient()
180+
const clientB = new QueryClient()
193181

194182
const provider = document.createElement(
195183
providerTagName,
@@ -238,20 +226,8 @@ describe('LQ-003 client-switch coverage across controllers', () => {
238226
})
239227

240228
it('should switch infinite query controller to new provider client while connected', async () => {
241-
const clientA = new QueryClient({
242-
defaultOptions: {
243-
queries: {
244-
retry: false,
245-
},
246-
},
247-
})
248-
const clientB = new QueryClient({
249-
defaultOptions: {
250-
queries: {
251-
retry: false,
252-
},
253-
},
254-
})
229+
const clientA = new QueryClient()
230+
const clientB = new QueryClient()
255231

256232
const provider = document.createElement(
257233
providerTagName,
@@ -356,20 +332,8 @@ describe('LQ-003 client-switch coverage across controllers', () => {
356332
})
357333

358334
it('should reparent queries controller under a different provider without cross-tree leakage', async () => {
359-
const clientA = new QueryClient({
360-
defaultOptions: {
361-
queries: {
362-
retry: false,
363-
},
364-
},
365-
})
366-
const clientB = new QueryClient({
367-
defaultOptions: {
368-
queries: {
369-
retry: false,
370-
},
371-
},
372-
})
335+
const clientA = new QueryClient()
336+
const clientB = new QueryClient()
373337

374338
const providerA = document.createElement(
375339
providerTagName,
@@ -428,20 +392,8 @@ describe('LQ-003 client-switch coverage across controllers', () => {
428392
})
429393

430394
it('should reparent infinite query controller under a different provider and bind the new nearest client', async () => {
431-
const clientA = new QueryClient({
432-
defaultOptions: {
433-
queries: {
434-
retry: false,
435-
},
436-
},
437-
})
438-
const clientB = new QueryClient({
439-
defaultOptions: {
440-
queries: {
441-
retry: false,
442-
},
443-
},
444-
})
395+
const clientA = new QueryClient()
396+
const clientB = new QueryClient()
445397

446398
const providerA = document.createElement(
447399
providerTagName,

‎packages/lit-query/src/tests/context-provider.test.ts‎

Lines changed: 15 additions & 15 deletions

0 commit comments

Comments
 (0)