When running Cypress tests in Electron, MSW activation occurs after test completion, causing tests to fail #2114
Labels
bug
Something isn't working
needs:triage
Issues that have not been investigated yet.
scope:browser
Related to MSW running in a browser
Prerequisites
Environment check
msw
versionBrowsers
No response
Reproduction repository
https://github.com/jolientb/msw-cypress.git
Reproduction steps
Current behavior
Cypress test fails in Electron browser
When you run the cypress e2e test in the Electron browser for the first time the test fails, because msw is only enabled after the test has finished. When running the test again in the same session, msw is enabled on time and the test does succeed.
Ps. When running the test in the chrome browser or in Electron 118 (headless) msw is enabled on time, and the test succeeds. And I tried adding an await before worker.start(), but this doesn't solve the problem.
Expected behavior
Electron browser: MSW should be enabled before test is completed
When you run the cypress e2e test in the Electron browser for the first time, msw should be enabled before the test finishes and the test should succeed (just like in the Chrome browser).
The text was updated successfully, but these errors were encountered: