-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Here is a test case in test/unit/regression/bugs.js:
describe('9999', function () {
it('should have status code in axios error', async function () {
const instance = axios.create({
baseURL: "https://postman-echo.com",
adapter: "fetch",
});
try {
await instance.get("/status/400");
} catch (error) {
assert.equal(error.name, "AxiosError");
assert.equal(error.isAxiosError, true);
assert.equal(error.status, 400);
}
});
});
It is passed in commit 08b84b5 v1.13.2 tag. However, it is failed in ab06109 v1.13.3 and 9336cf9 v1.13.4 tag.
$ npx mocha test/unit/regression/bugs.js
issues
4999
✔ should not fail with query parsing (235ms)
5028
✔ should handle set-cookie headers as an array
9999
1) should have status code in axios error
2 passing (750ms)
1 failing
1) issues
999
should have status code in axios error:
AssertionError [ERR_ASSERTION]: undefined == 400
at Context.<anonymous> (file:///Users/herman/Documents/github/axios/test/unit/regression/bugs.js:55:16)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels