2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

refactor(helpers): optimize the logic of isAxiosError (#3546)

1. add the judgment of null

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Black-Hole
2021-12-23 03:09:33 +08:00
committed by GitHub
parent 476ee88442
commit 6fca6a7027
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -17,4 +17,9 @@ describe('helpers::isAxiosError', function () {
expect(isAxiosError(new Error('Boom!')))
.toBe(false);
});
it('should return false if the error is null', function () {
expect(isAxiosError(null))
.toBe(false);
});
});