Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# - swift,schema-swift # pgp issue
- javascript-prop-types
- ruby
- php
- php,schema-php
- scala3,schema-scala3
- elixir,schema-elixir,graphql-elixir
- comment-injection-treesitter,comment-injection-typescript,comment-injection-typescript-zod,comment-injection-typescript-effect-schema
Expand Down
27 changes: 27 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Repository conventions

## Testing

quicktype's primary testing method is end-to-end fixture tests driven by JSON
and JSON Schema files. For each sample input, the fixture generates code for a
language, runs a driver program in `test/fixtures/<language>/` that
deserializes the sample and serializes it back, and compares the round-tripped
JSON to the input.

- JSON inputs live in `test/inputs/json/`: `priority/` and `samples/` always
run, `misc/` is skipped under `QUICKTEST` (and for languages with
`skipMiscJSON`).
- JSON Schema inputs live in `test/inputs/schema/`: each `*.schema` comes with
`.N.json` samples and `.N.fail.<feature>.json` expected-failure samples. A
fail sample must make the generated program exit nonzero; which fail
samples run is controlled by the language's `features` list.
- Per-language configuration — which inputs run (`skipJSON`, `includeJSON`,
`skipSchema`), renderer options, and `features` — lives in
`test/languages.ts`; fixtures are registered in `test/fixtures.ts`.
- Run one language's fixtures with `FIXTURE=<name> script/test`, for example
`FIXTURE=php script/test` or `FIXTURE=schema-php script/test`.

Any change that affects generated output MUST be covered by a JSON or JSON
Schema fixture test — by enabling existing inputs for the language or adding
new ones. Unit tests in `test/unit/` are a complement for what fixtures cannot
express (asserting that some code is *not* generated, API-level behavior, fast
local iteration) — never a substitute.

## Releasing / version bumps

Do not bump versions in any `package.json` before a release. Package manifest
Expand Down
Loading
Loading