Skip to content

How do you mock an error body correctly to work with Axios? #1872

Closed Answered by kettanaito
MyGuyCai asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @MyGuyCai. Your setup seems to be correct. To confirm that, I've added a test case for mocking error responses with Axios (#1891), which passes without issues. I encourage you to take a look at that test and see if you can spot any difference with what you have. I suspect you get a false-positive 400 response, to which the empty data points at.

If your exploration proves unfruitful, please submit a reproduction repository where I can reproduce this bug. I'd be happy to take a look and help you figure it out.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kettanaito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants