Recipes

End-to-end crust workflows you can lift directly.

Hand-picked workflows. Each recipe is a focused scenario — what the goal is, the crust pipeline that gets you there, and the knobs you’ll want to turn.

Load

Stress testing

Paced load scenarios with ramps and drop accounting, soak runs with windowed stats —every summaries, and test-fixture -nN -jM with randomized inputs and p50/p95/p99 reports.

Read recipe →
Load

CI load gates

stats | assert (s => s.p95 < 200) — chained thresholds, baseline comparison via stats —out, warmup patterns, and exit codes CI can trust.

Read recipe →
HTTP

OpenAPI mock server

Boot a Bun.serve mock from any OpenAPI 3.x spec — envelope-aware —stateful CRUD persisted to sqlite/postgres with —state, seeded with —seed, plus —validate 422s and a —proxy conformance audit.

Read recipe →
HTTP

Generated negative fixtures

gen-fixtures spec.json derives the 401/403/404 matrix, per-field 400 and boundary cases, and capture-chained CRUD flow suites from your OpenAPI spec.

Read recipe →
HTTP

Verify web links + SEO

Crawl from sitemap.xml, catch broken links and dead anchors, flag redirect chains, and diff Open Graph / meta tags against .crust.ts fixtures.

Read recipe →
HTTP

API smoke tests

read fixtures/*.json | POST :3000/users | expect 201 — one line per test, or whole .pipes suites with sql/assert DB checks between requests.

Read recipe →
Dev

One dev tail

procs({web, api, tsc}) merges every dev process into one tagged stream — pipe it through pino-pretty for a single coherent log.

Read recipe →
Files

Log mining

Forensic queries over log trees, live streams from any command via stdin, and the interactive logs session.

Read recipe →
Profiling

Heap snapshots during testing

A Bun [test].preload that writes a .heapsnapshot and prints rss / heap / top-classes after every bun test.

Read recipe →