mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Improve error handling
This commit is contained in:
@@ -58,7 +58,12 @@ describe('core::settle', function() {
|
||||
};
|
||||
settle(resolve, reject, response);
|
||||
expect(resolve).not.toHaveBeenCalled();
|
||||
expect(reject).toHaveBeenCalledWith(response);
|
||||
expect(reject).toHaveBeenCalled();
|
||||
var reason = reject.calls.first().args[0];
|
||||
expect(reason instanceof Error).toBe(true);
|
||||
expect(reason.message).toBe('Request failed with status code 500');
|
||||
expect(reason.config).toBe(response.config);
|
||||
expect(reason.response).toBe(response);
|
||||
});
|
||||
|
||||
it('should pass status to validateStatus', function() {
|
||||
|
||||
Reference in New Issue
Block a user