testing library
Test helpers for the Coffrify SDK — fixtures and a webhook payload
signer. Import this only from dev_dependencies consumers (tests,
integration suites).
Classes
- Fixtures
- Static factories for building plausible Coffrify objects in tests.
- MockHttpClient
-
A drop-in
http.Clientthat records every request and serves scripted responses. Use it viaCoffrifyConfiguration(httpClient: ...)in tests. - MockRequest
- Description of an incoming request as seen by MockHttpClient.
- MockResponse
- Description of a stubbed response.
Functions
-
signPayloadTest(
{required String secret, required Object body, String? id, int? timestampSeconds}) → SignedPayload -
Sign
bodyforsecretand return the headers a Coffrify webhook would carry. Defaults to the Standard Webhooks v1 format.
Typedefs
-
MockResponder
= FutureOr<
MockResponse> Function(MockRequest req) - Function signature for a mock response producer.
-
SignedPayload
= ({String body, Map<
String, String> headers}) -
Forged payload bundle: the
bodystring and the headers a Coffrify webhook would carry.