And I'd love to mock this on the unit test with msw/node.
But it's not possible to load customServiceWorker.js in same manner with worker since server's listen method doesn't support this option inconsistently.
Should this option be supported for the consistency?
This would allow for consistent behavior between browser and node environments when using custom worker scripts, improving the flexibility and ease of use of MSW in various testing scenarios.
Scope
Improves an existing behavior
Compatibility
It's going to be additional option so it would be backward compatible without breaking changes.
Feature description
I'm using custom path for the script which importing auto-generated
mockServiceWorker.js
:And I'd love to mock this on the unit test with
msw/node
.But it's not possible to load
customServiceWorker.js
in same manner with worker since server'slisten
method doesn't support this option inconsistently.Should this option be supported for the consistency?
i.e.
This would allow for consistent behavior between browser and node environments when using custom worker scripts, improving the flexibility and ease of use of MSW in various testing scenarios.