expose createSetupServer
as part of msw's public API?
#1130
Replies: 2 comments 1 reply
-
Hey, @robin-drexler. As of now, there are no plans to make I'd highly recommend using MSW in your app and then opening it in Playwright (browser). I somewhat disagree with your concerns with this approach, as it'd require 0 changes on your Playwright setup—the worker will be created and registered as a part of your application's code. This also means that your E2E tests and local development reuse the same setup (which is less setup). We do expose a low-level request interception API in Node.js but I think that's not what you're looking for. |
Beta Was this translation helpful? Give feedback.
-
hey @kettanaito, thanks for getting back, I really do appreciate it. :)
Yep, that's actually what I was using before I discovered
I understand what you're saying, but in my concrete example, we already have two setups, one for jest and one for storybook (which share some handlers, but not all of them)
That's fair.
That's true, I just wonder how one would cross the browser bridge to call I know that APIs like |
Beta Was this translation helpful? Give feedback.
-
Hey,
I was experimenting a bit with connecting
msw
andplaywright
🤝 and the proof of concept looks quite promising: https://github.com/robin-drexler/msw-playwrightHowever, to not copy-paste the entire
resolver
frommsw
'snode
andreact-native
setupServer
, I usedpatch-package
to re-exportcreateSetupServer
.I'm now wondering if you would consider exposing
createSetupServer
for libraries that want to build node-based custom servers?I acknowledge that this would widen the package's scope and could technically lead to more breaking changes, but it seems quite useful to enable more custom implementations.
Beta Was this translation helpful? Give feedback.
All reactions