David Hvilava
05/25/2023, 4:31 PM.WithProviderStateUrl(
providerStateUrl,
(e) => {
e.WithTeardown();
Console.WriteLine("Provider state teardown executed.");
});
Matt (pactflow.io / pact-js / pact-go)
05/25/2023, 10:12 PMDavid Hvilava
05/26/2023, 8:15 AMMatt (pactflow.io / pact-js / pact-go)
05/26/2023, 9:29 AMDavid Hvilava
05/26/2023, 9:31 AM.WithProviderStateUrl(
providerStateUrl,
(e) => { e.WithTeardown(); });
It will send an extra request to "provider-states" middleware with new property "action":"teardown".
2. In a test you can define Setup and Teardown delegates for each provider state.
3. In "provider-states" middleware call corresponding delegate depending on received "action" property value (for setup use "action":"setup").