# Testing signals — colinhacks/zod

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

# Testing signals — colinhacks/zod

Scanned commit 10dda3a3a4bc76ed0bf83e994de194587e489ef8 (2026-09-21). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Testing is broad and strongly integrated into normal development and CI. Vitest combines runtime assertions and TypeScript type checking, while a second project reruns the entire Zod test corpus with global AOT compilation enabled. Dedicated suites cover runtime semantics, compiler parity, JSON Schema conversion, cyclic data, package resolution, integrations, tree-shaking, and documentation consistency. Performance and randomized compiler fuzzing also exist, although the fuzzer is intentionally not part of deterministic CI.
- The root Vitest configuration discovers every package project plus a dedicated compile-mode project, isolates tests, type-checks `*.test.ts`, and fails tests that write to console. — [vitest.config.ts#L7-31](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/vitest.config.ts#L7-L31) [scripts/fail-on-console.ts#L1-20](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/scripts/fail-on-console.ts#L1-L20)
- Compile mode includes every `packages/zod/src/**/*.test.ts` file, disables redundant type checking, and imports the production `zod/compile` side-effect module before tests. — [vitest.compile.config.ts#L7-31](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/vitest.compile.config.ts#L7-L31) [scripts/enable-compile.ts#L1-21](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/scripts/enable-compile.ts#L1-L21)
- The v4 classic suite is organized by schema behavior and includes focused files for objects, strings, codecs, cyclic data, optionality, registries, Standard Schema, JSON Schema, transforms, errors, and ReDoS cases. — [packages/zod/src/v4/classic/tests/object.test.ts](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/tests/object.test.ts) [packages/zod/src/v4/classic/tests/codec.test.ts](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/tests/codec.test.ts) [packages/zod/src/v4/classic/tests/cyclic-data.test.ts](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/tests/cyclic-data.test.ts) [packages/zod/src/v4/classic/tests/redos.test.ts](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/tests/redos.test.ts) [packages/zod/src/v4/classic/tests/registries.test.ts](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/tests/registries.test.ts)
- The compiler has direct unit tests plus differential tests that compare success, issues, prototype identity, own-key order, symbols, array holes, frozen state, NaN, negative zero, thrown-error classes, and union branch soundness. — [packages/zod/src/v4/core/tests/compile.test.ts#L1-40](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/tests/compile.test.ts#L1-L40) [packages/zod/src/v4/core/tests/compile-differential.test.ts#L1-98](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/tests/compile-differential.test.ts#L1-L98) [packages/zod/src/v4/core/tests/compile-differential.test.ts#L101-155](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/tests/compile-differential.test.ts#L101-L155)
- JSON Schema conversion has large dedicated suites in both directions, while core processors are also exercised by compile mode because they live under the same package project. — [packages/zod/src/v4/classic/tests/to-json-schema.test.ts](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/tests/to-json-schema.test.ts) [packages/zod/src/v4/classic/tests/from-json-schema.test.ts](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/tests/from-json-schema.test.ts) [vitest.compile.config.ts#L23-30](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/vitest.compile.config.ts#L23-L30)
- Bundle tests build real fixtures with esbuild, enforce gzip ceilings for classic and mini bundles, and assert that unrelated feature identifiers and regexes are absent after tree-shaking. — [packages/treeshake/bundle-size.test.ts#L69-124](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/treeshake/bundle-size.test.ts#L69-L124) [packages/treeshake/package.json#L6-24](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/treeshake/package.json#L6-L24)
- Built-package compatibility is tested separately: resolution tests run Are The Types Wrong and executable CJS/ESM probes, while integration fixtures type-check source and built packages under bundler, NodeNext, and Node16 CommonJS modes. — [packages/resolution/package.json#L18-34](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/resolution/package.json#L18-L34) [packages/resolution/attw.test.ts#L1-44](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/resolution/attw.test.ts#L1-L44) [packages/integration/package.json#L15-23](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/integration/package.json#L15-L23)
- CI tests TypeScript 5.5, 6, and latest on Node LTS, builds before tests, runs integration and resolution checks, and separately enforces formatting, linting, comment style, and circular-dependency checks. — [.github/workflows/test.yml#L15-41](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/test.yml#L15-L41) [.github/workflows/test.yml#L43-72](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/test.yml#L43-L72)
- The release workflow repeats build, test, resolution, integration, lint, and circular-dependency checks before gaining publish permissions. — [.github/workflows/release.yml#L8-68](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L8-L68) [.github/workflows/release.yml#L79-95](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L79-L95)
- The seeded compiler fuzzer generates nested schema grammars and compares interpreted and compiled outputs, issues, and union behavior, but its header explicitly states that it is a hunting tool rather than a CI job. — [scripts/compile-fuzz.ts#L1-12](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/scripts/compile-fuzz.ts#L1-L12) [scripts/compile-fuzz.ts#L80-214](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/scripts/compile-fuzz.ts#L80-L214)
- Documentation-specific automated coverage is narrow: the checked-in docs test validates parity of code-block heights between classic and mini API tabs, while route rendering and external search/chat behavior have no corresponding route-level test file. (inferred) — [packages/docs/content/api.test.ts#L1-51](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/content/api.test.ts#L1-L51) [packages/docs/vitest.config.ts#L1-14](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/vitest.config.ts#L1-L14) [packages/docs/app/(doc)/[[...slug]]/page.tsx](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/app/(doc)/%5B%5B...slug%5D%5D/page.tsx) [packages/docs/components/inkeep-search.tsx](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/components/inkeep-search.tsx)

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)
