Contract tests from your OpenAPI spec — generated, owned, and drift-protected. Zero config. One command. Runs in your CI.
Blog: why specs drift & how to catch it in CI · GitHub · npm
Your API spec rotates. Your tests drift. Nobody notices until production does. Keeping hand-written documentation and assertion suites in sync is manual, boring work that everyone skips under pressure.
SpecCaster makes the spec the contract: it generates a node:test suite
into your repo, and your CI fails the build whenever the committed suite falls
out of sync with the spec.
node:test files. Extend them, don't fight a framework.speccaster drift blocks PRs when spec and suite disagree.npx speccaster init. No server, no credentials, no SaaS dashboard.npx speccaster demo # prove it in seconds # ephemeral API + generated suite + drift demo, nothing written npx speccaster init --spec openapi.yaml # then your own suite # writes speccaster/contract.test.js + .github/workflows/speccaster.yml SPECCASTER_BASE_URL=http://localhost:8080/v1 \ node --test speccaster/contract.test.js
Works with OpenAPI 3.0/3.1 (JSON or YAML). Node 18+. Exercised against the GitHub REST spec (815 paths) and the Swagger Petstore 3.0.4 spec.
# auto-generated workflow
- name: Regenerate + drift gate
run: npx -y speccaster@latest drift --spec openapi.yaml --out speccaster/contract.test.js
- name: Run contract tests
env:
SPECCASTER_BASE_URL: ${{ secrets.SPECCASTER_BASE_URL }}
run: node --test speccaster/contract.test.js
This is an early MVP. Stars, installs and revenue are tracked publicly as they happen — nothing is asserted before it is real.