# Testing signals — TanStack/query

> Canonical page: https://codevetter.com/unpack/query/testing-signals

# Testing signals — TanStack/query

Scanned commit 29859ae60c8dca0a5cdbf8abccc775b655cf43e2 (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Tests and CI were inspected, not executed; test existence and assertions are not passing results. The inspected suites use Vitest, fake timers, jsdom, React Testing Library, and type assertions. They exercise cache timing, observer transitions, mutation queues, hydration, restoration, and throttling. This inventory is bounded: the sampled tests do not establish production network, storage, browser, or every-adapter coverage.
- Core Vitest configuration searches src, disables watch, uses jsdom, enables typechecking and restored mocks, and enables Istanbul source coverage when CI is set. — [packages/query-core/vite.config.ts#L17-L30](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/vite.config.ts#L17-L30)
- query.test.tsx constructs a mounted client with fake timers and asserts longest-observed gcTime plus retry continuation after visibility restoration using simulated events. — [packages/query-core/src/__tests__/query.test.tsx#L21-L109](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/__tests__/query.test.tsx#L21-L109)
- The mutation scope test submits two mutations with the same scope, asserts the second is paused, and expects start-A/finish-A/start-B/finish-B ordering after advancing timers. — [packages/query-core/src/__tests__/mutation.test.tsx#L410-L468](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/__tests__/mutation.test.tsx#L410-L468)
- Hydration tests check Date serialization without mutating cached data, opt-out error redaction for a pending promise, and JSON round trips for multiple serializable data shapes. — [packages/query-core/src/__tests__/hydration.test.tsx#L43-L80](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/__tests__/hydration.test.tsx#L43-L80) [packages/query-core/src/__tests__/hydration.test.tsx#L84-L145](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/__tests__/hydration.test.tsx#L84-L145)
- React's successful-query test asserts the complete pending/fetching → success/idle result transition; its configuration uses a React plugin, jsdom, setup files, and three retries in CI. — [packages/react-query/src/__tests__/useQuery.test.tsx#L71-L155](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/react-query/src/__tests__/useQuery.test.tsx#L71-L155) [packages/react-query/vite.config.ts#L19-L34](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/react-query/vite.config.ts#L19-L34)
- PersistQueryClientProvider tests use an in-memory mock persister and assert idle fetching while restoring, hydrated data, and subsequent fetched data; this sampled test does not exercise real localStorage failures. — [packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx#L17-L30](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx#L17-L30) [packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx#L61-L136](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx#L61-L136)
- Type tests assert tagged-key inference using expectTypeOf, package scripts compile against TS 5.6–5.9, the catalog compiler, and TS 7.0, and asyncThrottle tests assert coalescing and interval timing. — [packages/query-core/src/__tests__/queryClient.test-d.tsx#L100-L107](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/__tests__/queryClient.test-d.tsx#L100-L107) [packages/query-core/package.json#L21-L30](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/package.json#L21-L30) [packages/query-async-storage-persister/src/__tests__/asyncThrottle.test.ts#L14-L74](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-async-storage-persister/src/__tests__/asyncThrottle.test.ts#L14-L74)
- PR CI starts distributed Nx agents and invokes test:pr; configured targets include lint, runtime/type/package checks and builds, while preview CI separately builds, publishes previews, and checks bundle size. No CI outcome was retrieved or executed. — [.github/workflows/pr.yml#L23-L40](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/.github/workflows/pr.yml#L23-L40) [.github/workflows/pr.yml#L54-L68](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/.github/workflows/pr.yml#L54-L68) [package.json#L15-L25](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/package.json#L15-L25)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
