MCPcopy
hub / github.com/TanStack/query / mockVisibilityState

Function mockVisibilityState

packages/query-test-utils/src/mockVisibilityState.ts:4–7  ·  view source on GitHub ↗
(
  value: DocumentVisibilityState,
)

Source from the content-addressed store, hash-verified

2import type { MockInstance } from 'vitest'
3
4export const mockVisibilityState = (
5 value: DocumentVisibilityState,
6): MockInstance<() => DocumentVisibilityState> =>
7 vi.spyOn(document, 'visibilityState', 'get').mockReturnValue(value)

Callers 3

useQuery.test.tsxFile · 0.90
useQuery.test.tsxFile · 0.90
query.test.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…