2
0
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:
Rubén Norte
2017-04-08 21:43:04 +02:00
parent 5c8095e483
commit e0d59eb29b
4 changed files with 23 additions and 8 deletions
+4 -3
View File
@@ -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);
});