mswjs / interceptors

Low-level network interception library.
https://npm.im/@mswjs/interceptors
MIT License
523 stars 118 forks source link

RemoteHttpResolver example in README is missing the ".apply()" call #582

Closed DenyVeyten closed 5 days ago

DenyVeyten commented 3 weeks ago

Example in README: https://github.com/mswjs/interceptors/blob/e822e14bc669a7e5cefa9b9b0f627ea37c76ba99/README.md?plain=1#L524-L539

Missing line: https://github.com/mswjs/interceptors/blob/e822e14bc669a7e5cefa9b9b0f627ea37c76ba99/test/features/remote/remote.test.ts#L33

Took me plenty of time to find out that RemoteHttpResolver starts working only after resolver.apply() has been called.

kettanaito commented 1 week ago

Hi, @DenyVeyten. Thanks for reporting this!

Yes, you have to call .apply() to enable any interceptor. RemoteHttpResolver extends that model. Looks like a documentation issue to me.

Would you like to open a pull request to README to fix this?

kettanaito commented 5 days ago

Released: v0.30.1 🎉

This has been released in v0.30.1!

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


Predictable release automation by @ossjs/release.