Skip to content

Commit cbc0246

Browse files
test(react-query): wrap negative type tests in assertType
Addresses CodeRabbit nitpick: vitest/expect-expect flagged the genuine-conflict test as having no assertions. Wrap both calls in assertType() so the linter sees an explicit assertion while the `@ts-expect-error` directives continue to enforce the type mismatch. Co-Authored-By: Claude <[email protected]>
1 parent 1546819 commit cbc0246

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

packages/react-query/src/__tests__/queryOptions.test-d.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,22 @@ describe('queryOptions', () => {
303303
it('should still error when persister and queryFn return types genuinely conflict', () => {
304304
const persister = undefined as unknown as QueryPersister<string, any>
305305

306-
queryOptions({
307-
queryKey: ['key'],
308-
// @ts-expect-error persister expects string, queryFn returns number
309-
queryFn: () => 42,
310-
persister,
311-
})
306+
assertType(
307+
queryOptions({
308+
queryKey: ['key'],
309+
// @ts-expect-error persister expects string, queryFn returns number
310+
queryFn: () => 42,
311+
persister,
312+
}),
313+
)
312314

313-
queryOptions({
314-
queryKey: ['key'],
315-
// @ts-expect-error persister expects string, queryFn with arg returns number
316-
queryFn: (_context) => 42,
317-
persister,
318-
})
315+
assertType(
316+
queryOptions({
317+
queryKey: ['key'],
318+
// @ts-expect-error persister expects string, queryFn with arg returns number
319+
queryFn: (_context) => 42,
320+
persister,
321+
}),
322+
)
319323
})
320324
})

0 commit comments

Comments
 (0)