Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I built a local CLI to regression-test Stripe webhooks with real event fixtures

Описание и применение

CLI Spoke Hooks позволяет сохранять реальные события Stripe в виде фикстур и сравнивать их с текущим поведением обработчика, обеспечивая регрессионное тестирование в CI.

Задача

Preserving real production-shaped webhook events as regression fixtures instead of relying only on generated or happy-path test payloads.

Результат

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.

Рабочий процесс

  • 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

Доказательства

The CLI exits with a non-zero status, so the same test can be used in CI.

Источник

  • Дата записи: 2026-09-15T11:00:39.998Z