controlling server-side mocks from within Cypress tests #1510
cellog
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, I just released https://github.com/cellog/msw-server-helper#readme
tl;dr - making controlling msw server mocks in apps like remix/nextjs from cypress tests possible
The solution is simple: it uses an sqlite database to store mock overrides. You register several possible server mocks and then can dynamically swap between them in a test. If there are a related set of mocks, you can also pass in arguments to the mock.
Example:
Beta Was this translation helpful? Give feedback.
All reactions