I built a local CLI to regression-test Stripe webhooks with real event fixtures
Description and use
Spoke Hooks CLI records real Stripe webhook events as fixtures and compares them to current handler behavior, enabling regression testing in CI.
Problem
Preserving real production-shaped webhook events as regression fixtures instead of relying only on generated or happy-path test payloads.
Outcome
The CLI records real Stripe webhook events as fixtures, records current handler behavior as a baseline, and compares post-change behavior, failing tests on status or body mismatches, enabling CI integration.
Workflow
- Install the CLI: npm install -D @spoke-labs/hooks
- Initialize: npx spoke-hooks init
- Add a Stripe event payload: npx spoke-hooks add stripe-event.json
- Record baseline: npx spoke-hooks baseline
- After code changes, replay event: npx spoke-hooks test
Evidence
The CLI exits with a non-zero status, so the same test can be used in CI.
- Record date: 2026-09-15T11:00:39.998Z