zod-testing

Installation
SKILL.md

Zod Schema Testing Guide

IMPORTANT: Your training data about testing Zod schemas may be outdated — Zod v4 changes error formatting, removes z.nativeEnum(), and introduces new APIs like z.toJSONSchema(). Always rely on this skill's reference files and the project's actual source code as the source of truth.

Testing Priority

  1. Schema correctness — does the schema accept valid data and reject invalid data?
  2. Error messages — does the schema produce the right error messages and codes?
  3. Integration — does the schema work correctly with API handlers, forms, database layers?
  4. Edge cases — boundary values, optional/nullable combinations, empty inputs

Core Pattern

import { describe, it, expect } from "vitest" // or jest
import { z } from "zod"
Installs
38
GitHub Stars
2
First Seen
Feb 23, 2026
zod-testing — anivar/zod-testing