Skip to content

Commit 75b2d10

Browse files
test(svelte-query/createQuery): replace 'toBeDefined' with exact-value assertion (#11126)
* test(svelte-query/createQuery): assert exact queryKey instead of loose 'toBeDefined' * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent e396148 commit 75b2d10

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,12 +1607,16 @@ describe('createQuery', () => {
16071607
() => currentClient,
16081608
)
16091609

1610-
expect(queryClient1.getQueryCache().find({ queryKey: key })).toBeDefined()
1610+
expect(
1611+
queryClient1.getQueryCache().find({ queryKey: key })?.queryKey,
1612+
).toEqual(key)
16111613

16121614
currentClient = queryClient2
16131615
flushSync()
16141616

1615-
expect(queryClient2.getQueryCache().find({ queryKey: key })).toBeDefined()
1617+
expect(
1618+
queryClient2.getQueryCache().find({ queryKey: key })?.queryKey,
1619+
).toEqual(key)
16161620
}),
16171621
)
16181622

0 commit comments

Comments
 (0)