mswjs / msw

Industry standard API mocking for JavaScript.
https://mswjs.io
MIT License
15.97k stars 519 forks source link

fix(types): add generic type to MockedRequest.passthrough #2198

Closed sbaechler closed 2 months ago

sbaechler commented 4 months ago

This allows using request.passthrough() in a handler that also returns data.

Closes #2195

I was not able to run the test suite without errors even in the backport/v1 branch. There were no type errors though.

kettanaito commented 2 months ago

Hi, @sbaechler. Thanks for shipping this backport fix!

I've tested it locally and all tests seem passing.

// pnpm test:browser
192 passed (4.1m)

I've tested this using our type tests at the time with TS versions 4.8 - 5.2, all type tests are passing as well. I think this should be good to go.

kettanaito commented 2 months ago

Released: v1.3.4 🎉

This has been released in v1.3.4!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.