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
I have noticed that the passthrough function from MSW does not work, and these routes are never completed. I can create my own passthrough function that does work: http.get("*", ({request}) => fetch(request)));, but I would expect the playwright version to work as well.
pnpm dev - this will run the app without MSW running in the browser. The expectation being that when we run playwright against this local server, playwright will intercept requests.
Notice that It shows 100 posts. This is the live value from the API we are fetching data from.
Run pnpm run test. The test will fail because the browser never loaded. It was not able to fetch the requests at http://localhost:5173/* despite the passthrough configured.
Comment out the default MSW passthrough and use the custom passthrough defined below.
Rerun tests. They should now pass
The text was updated successfully, but these errors were encountered:
I have been trying to set up playwright-msw with
I have noticed that the
passthrough
function from MSW does not work, and these routes are never completed. I can create my own passthrough function that does work:http.get("*", ({request}) => fetch(request)));
, but I would expect the playwright version to work as well.I've created a reproduction repo here: https://github.com/kristojorg/vite-playwright-msw.git
Steps to reproduce
pnpm install
pnpm dev
- this will run the app without MSW running in the browser. The expectation being that when we run playwright against this local server, playwright will intercept requests.pnpm run test
. The test will fail because the browser never loaded. It was not able to fetch the requests athttp://localhost:5173/*
despite the passthrough configured.The text was updated successfully, but these errors were encountered: