Skip to content

Commit 0b982b6

Browse files
cameroncookecodex
andcommitted
test(snapshot): Add JSON fixture schema validation
Add a dedicated schema corpus for structured JSON fixtures and validate each discovered fixture against its declared schema and version. This gives the hand-crafted fixture contracts an executable check without coupling them to the existing text snapshot harness. Co-Authored-By: OpenAI Codex <noreply@openai.com>
1 parent 4f7d3b0 commit 0b982b6

File tree

31 files changed

+3561
-56
lines changed

31 files changed

+3561
-56
lines changed

package-lock.json

Lines changed: 59 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"license:check": "npx -y license-checker --production --onlyAllow 'MIT;ISC;BSD-2-Clause;BSD-3-Clause;Apache-2.0;Unlicense;FSL-1.1-MIT'",
4747
"knip": "knip",
4848
"test": "vitest run",
49+
"test:schema-fixtures": "vitest run --config vitest.snapshot.config.ts src/snapshot-tests/__tests__/json-fixture-schema.test.ts",
4950
"test:snapshot": "npm run build && node build/cli.js daemon stop 2>/dev/null; vitest run --config vitest.snapshot.config.ts",
5051
"test:snapshot:update": "npm run build && node build/cli.js daemon stop 2>/dev/null; UPDATE_SNAPSHOTS=1 vitest run --config vitest.snapshot.config.ts",
5152
"test:smoke": "npm run build && vitest run --config vitest.smoke.config.ts",
@@ -99,6 +100,7 @@
99100
"@types/yargs": "^17.0.33",
100101
"@vitest/coverage-v8": "^3.2.4",
101102
"@vitest/ui": "^3.2.4",
103+
"ajv": "^8.18.0",
102104
"eslint": "^9.23.0",
103105
"eslint-config-prettier": "^10.1.1",
104106
"eslint-plugin-prettier": "^5.2.5",

0 commit comments

Comments
 (0)