# Testing signals — pmndrs/valtio

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

# Testing signals — pmndrs/valtio

Scanned commit 26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d (2026-10-01). 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; no passing result or measured coverage is asserted. Vitest runs the tests directory in jsdom with React Testing Library and jest-dom support. Inspected suites cover core graph semantics, React rendering, utility behavior, regressions, and selected performance/memory contracts. This bounded inspection does not establish exhaustive coverage, and the root configuration does not directly include website or example application tests.
- Vitest aliases valtio imports to src, uses jsdom, global APIs, tests/setup.ts, and tests as its discovery directory; V8 coverage output is configured, but the inspected CI command is plain test:spec and no coverage threshold appears in this config. — [vitest.config.mts#L4-L28](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/vitest.config.mts#L4-L28) [tests/setup.ts#L1-L1](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/setup.ts#L1-L1) [.github/workflows/test.yml#L24-L29](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/.github/workflows/test.yml#L24-L29)
- Vanilla tests specify object validation, proxy-cache identity, wrappers, child replacement, descriptors, shadowing __proto__/constructor properties, snapshot reuse/read-only properties, subscription batching, synchronous notification, and queued-callback cancellation. — [tests/vanilla/proxy.test.ts#L6-L32](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/vanilla/proxy.test.ts#L6-L32) [tests/vanilla/proxy.test.ts#L92-L215](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/vanilla/proxy.test.ts#L92-L215) [tests/vanilla/snapshot.test.ts#L100-L116](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/vanilla/snapshot.test.ts#L100-L116) [tests/vanilla/subscribe.test.ts#L112-L189](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/vanilla/subscribe.test.ts#L112-L189)
- React optimization tests use render spies, act, fireEvent, and fake timers to specify unchanged-leaf suppression, unwrapping snapshots assigned outside render, non-own deletion behavior, and changing accessed-key dependencies. — [tests/react/optimization.test.tsx#L1-L60](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/react/optimization.test.tsx#L1-L60) [tests/react/optimization.test.tsx#L62-L160](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/react/optimization.test.tsx#L62-L160)
- SSR tests assert renderToString output for current and nested state; async tests exercise Suspense with promise-backed values but skip those cases when React's use export is unavailable. — [tests/react/ssr.test.tsx#L1-L27](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/react/ssr.test.tsx#L1-L27) [tests/react/async.test.tsx#L1-L90](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/react/async.test.tsx#L1-L90)
- Collection suites specify historical snapshot lookup and mutation rejection; deepProxy cases cover object cycles, aliasing, collection normalization, and descriptors. DevTools tests cover unsubscribe and malformed ACTION payloads, and watch regression tests cover synchronous loops and async context isolation. — [tests/utils/proxyMap.test.tsx#L443-L514](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/utils/proxyMap.test.tsx#L443-L514) [tests/utils/deepProxy.test.ts#L126-L245](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/utils/deepProxy.test.ts#L126-L245) [tests/utils/devtools.test.tsx#L192-L225](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/utils/devtools.test.tsx#L192-L225) [tests/regression/watch.test.ts#L15-L71](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/regression/watch.test.ts#L15-L71)
- Memory tests use jest-leak-detector on simple/nested/cyclic proxies and unsubscribed state; the performance test samples 5,000 iterations at depths 4–256 and asserts a log-slope below 0.1 for cached snapshots with subscription, without providing results in this inspection. — [tests/perf/memoryleaks.test.ts#L1-L55](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/perf/memoryleaks.test.ts#L1-L55) [tests/perf/memoryleaks.test.ts#L59-L134](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/perf/memoryleaks.test.ts#L59-L134) [tests/perf/performance.test.ts#L4-L24](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/perf/performance.test.ts#L4-L24) [tests/perf/performance.test.ts#L52-L80](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tests/perf/performance.test.ts#L52-L80)
- Main CI is configured on main pushes and opened/synchronized PRs to install, check formatting/types/lint, run specs, and build; root TypeScript includes src/tests, while root ESLint explicitly ignores examples and website. — [.github/workflows/test.yml#L3-L29](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/.github/workflows/test.yml#L3-L29) [tsconfig.json#L18-L24](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/tsconfig.json#L18-L24) [eslint.config.mjs#L11-L12](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/eslint.config.mjs#L11-L12)
- Additional workflows configure CJS/ESM artifact testing in development mode, React 18/19/canary/experimental compatibility, and TypeScript 4.5–5.9 type checks with compatibility patches; the production build-matrix option is commented out. — [.github/workflows/test-multiple-builds.yml#L17-L19](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/.github/workflows/test-multiple-builds.yml#L17-L19) [.github/workflows/test-multiple-builds.yml#L31-L56](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/.github/workflows/test-multiple-builds.yml#L31-L56) [.github/workflows/test-multiple-versions.yml#L17-L27](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/.github/workflows/test-multiple-versions.yml#L17-L27) [.github/workflows/test-old-typescript.yml#L17-L33](https://github.com/pmndrs/valtio/blob/26d8ca8cb6e5bb3b9516d429e50bc5aab1f42e0d/.github/workflows/test-old-typescript.yml#L17-L33)

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)
