Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Sep 8, 2024

Conversation

a11rew
Copy link
Contributor

@a11rew a11rew commented Jun 14, 2024

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@a11rew a11rew marked this pull request as ready for review September 8, 2024 11:19
@kettanaito
Copy link
Member

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 kettanaito changed the title Support returning redirects in interceptors followable by "follow-redirects" test: add mock redirect response tests for "axios" and "follow-redirects" Sep 8, 2024
@kettanaito kettanaito merged commit c4b68ba into mswjs:main Sep 8, 2024
2 checks passed
@kettanaito
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Axios fails to follow redirects from MSW mocked responses
2 participants