You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unit tests which perform API calls (currently mocked by msw).
Is your feature request related to a problem? Please describe.
Keeping the server API and the client's expectation of the API in sync is difficult, and often leads to breaking changes in one which are not reflected in another.
Our tests are against a mocked server, and expectations of requests and responses are independent of the tests that are run when validating the actual server.
Describe the solution you'd like
This is a problem that Pact solves.
We should use Pact's msw adapter to replace our mocked server responses, and generate Pact files. These files can be similarly run against our server when performing its API tests.
Describe alternatives you've considered
Additional context
Related issues or community discussions
The text was updated successfully, but these errors were encountered:
This generates pact files based on interactions, but doesn't provide a convenient way to allow the pact files to be loaded a subsequent time to verify the interactions have not changed.
We could do this with pre-commit, by running the test, saving the files, and then determining if any files were changed.
Or we could manually load the files, and compare against the adapter's output - similar to this in-memory comparison.
What package are you referring to?
Unit tests which perform API calls (currently mocked by msw).
Is your feature request related to a problem? Please describe.
Keeping the server API and the client's expectation of the API in sync is difficult, and often leads to breaking changes in one which are not reflected in another.
Our tests are against a mocked server, and expectations of requests and responses are independent of the tests that are run when validating the actual server.
Describe the solution you'd like
This is a problem that Pact solves.
We should use Pact's msw adapter to replace our mocked server responses, and generate Pact files. These files can be similarly run against our server when performing its API tests.
Describe alternatives you've considered
Additional context
Related issues or community discussions
The text was updated successfully, but these errors were encountered: