add a charge webhook to our fake Stripe
Adding the charge event to the mock.
test/mocks/stripe/charge.ts
+1// fake Stripe charge webhook
+2await http.post("/webhooks/stripe", {
+3 type: "charge.completed",
+4 data: { id, amount },
+5})
Problem
add a charge webhook to our fake Stripe
Adding the charge event to the mock.
Blocked: a mock must conform to the real contract, not memory — read test/mocks/sources.yaml for the spec.
file_path:
test/mocks/stripe/charge.ts
content:
// fake Stripe charge webhook await http.post("/webhooks/stripe", { type: "charge.completed", data: { id, amount }, })
Solution