mswjs / mswjs.io

Official website and documentation for the Mock Service Worker library.
https://mswjs.io
151 stars 177 forks source link

fix: valid URI and URL for `getResponse` example to work every environment #385

Closed Hajime-san closed 5 months ago

Hajime-san commented 5 months ago

The current getResponse example code works only browser due to that the Request constructor generate a URL from the URI like /user. But it don't act well non-browser environment like node because of it requires URL. We should show better for both environment.

I picked it from here. https://github.com/mswjs/msw/blob/ad8ebac0c6b3c1dd66bf275b8c9d06370607e9c6/src/core/getResponse.test.ts#L41-L44

vercel[bot] commented 5 months ago

@Hajime-san is attempting to deploy a commit to the MSW Team on Vercel.

A member of the Team first needs to authorize it.