Summary
It would be useful to support filtering the set of interactions that are verified in Pact JS provider verification, especially during local development, debugging, or targeted CI workflows.
Problem
Today, provider verification generally runs the full interaction set. When trying to debug a specific failure or work on a subset of scenarios, this can be slow and awkward.
A common need is to verify only interactions that match:
- one or more interaction descriptions
- one or more provider states
Proposed API
One possible shape could be an additional option in PactProviderOptions, for example:
interactions: {
byDescription: [
"a request for a list of organizations",
"a request to get an organization by ID",
],
byState: [
"organization exists",
"organization does not exist",
],
}
This would allow targeted verification runs without needing to split Pact files or otherwise work around the verifier.
Use cases
- Debug a single failing interaction locally
- Verify only the interactions relevant to a feature under active development
- Reduce feedback time in development or focused CI jobs
- Narrow verification to a particular provider state while investigating test setup issues
Expected behavior
Ideally Pact JS could:
- filter by interaction description
- filter by provider state
- support multiple values for each
The exact semantics are open for discussion, for example:
- whether
byDescription and byState should be supported independently
- whether using both should behave as an intersection or union
Notes
This is intended as a developer-experience improvement for provider verification rather than a replacement for full verification in CI.
Summary
It would be useful to support filtering the set of interactions that are verified in Pact JS provider verification, especially during local development, debugging, or targeted CI workflows.
Problem
Today, provider verification generally runs the full interaction set. When trying to debug a specific failure or work on a subset of scenarios, this can be slow and awkward.
A common need is to verify only interactions that match:
Proposed API
One possible shape could be an additional option in
PactProviderOptions, for example:This would allow targeted verification runs without needing to split Pact files or otherwise work around the verifier.
Use cases
Expected behavior
Ideally Pact JS could:
The exact semantics are open for discussion, for example:
byDescriptionandbyStateshould be supported independentlyNotes
This is intended as a developer-experience improvement for provider verification rather than a replacement for full verification in CI.