Skip to content

Add data-driven JSON validation fixtures - #62

Merged
schani merged 1 commit into
mainfrom
agent/json-fixture-tests
Jul 14, 2026
Merged

schani merged 1 commit into
mainfrom
agent/json-fixture-tests

Conversation

@schani

@schani schani commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add a recursive Vitest fixture runner for <name>.schema.json, <name>.pass.<case-id>.json, and <name>.fail.<case-id>.json
  • validate malformed names, orphaned cases, empty schema groups, and invalid JSON with path-specific errors
  • document the convention and add npm run test:fixtures
  • migrate all 239 existing validation-only tests into 229 schema files and 661 pass/fail inputs
  • retain TypeScript tests that inspect Zod structure or parsed output, exercise internal helpers, use non-JSON values, or construct recursive inputs programmatically

Why

Most validation regressions only need a JSON Schema plus accepted and rejected JSON values. Keeping those cases as data removes repetitive test code and makes new coverage possible by adding files alone.

Validation

  • vitest run tests/json-fixtures.test.ts — 661 passed
  • vitest run --coverage --exclude '.claude/**' — 1,962 passed, 104 skipped; 100% statements, lines, and functions
  • npm run build — passed

@schani
schani marked this pull request as ready for review July 14, 2026 13:57
@schani
schani merged commit 0797ede into main Jul 14, 2026
4 checks passed
@schani
schani deleted the agent/json-fixture-tests branch July 14, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant