mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Adding failing tests that verify errors contain the request
This commit is contained in:
@@ -49,15 +49,16 @@ describe('requests', function () {
|
||||
var reason = rejectSpy.calls.first().args[0];
|
||||
expect(reason instanceof Error).toBe(true);
|
||||
expect(reason.config.method).toBe('get');
|
||||
expect(reason.config.url).toBe('http://thisisnotaserver');
|
||||
expect(reason.config.url).toBe('http://thisisnotaserver/foo');
|
||||
expect(reason.request).toEqual(jasmine.any(XMLHttpRequest));
|
||||
|
||||
// re-enable jasmine.Ajax
|
||||
jasmine.Ajax.install();
|
||||
|
||||
|
||||
done();
|
||||
};
|
||||
|
||||
axios('http://thisisnotaserver')
|
||||
axios('http://thisisnotaserver/foo')
|
||||
.then(resolveSpy, rejectSpy)
|
||||
.then(finish, finish);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user