add a charge webhook to our fake Stripe
Adding the charge event to the mock.
Created
charge.ts
+5
test/mocks/stripe/charge.ts
+
1
// fake Stripe charge webhook
+
2
await 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.
Failed to create
charge.ts
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