mswjs / interceptors

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

test: add mock redirect response tests for "axios" and "follow-redirects" #581

Closed a11rew closed 3 weeks ago

a11rew commented 3 months ago

Overview

Adds failing test case (and fix, wip) for MSW issue #2177 - "follow-redirects" throwing an error when it receives a redirect response from an interceptor

kettanaito commented 3 months ago

Hi, @a11rew. Thanks for adding the test!

I will take a look at this once we merge #515. The latter is a huge rework in the http interception in Node.js, and I suspect that it may solve this issue already.

kettanaito commented 3 weeks ago

Hi, @a11rew 👋 I've updated the branch and fixed the tests, they are passing now. Can you please confirm that the issue you were experiencing has been fixed on the latest version of Interceptors?

kettanaito commented 3 weeks ago

I've added redirect response tests for Axios, they are passing as well! This looks ready to be merged.

kettanaito commented 3 weeks ago

Oh, don't mind me, I'm a dufus. The redirect to mock test was failing because I use .once() for the request listener. Fixed that, all the tests are passing! 🎉

kettanaito commented 3 weeks ago

Released: v0.35.0 🎉

This has been released in v0.35.0!

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.