2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

Instances created from axios.create have same API as default axios

closes #217
This commit is contained in:
Matt Zabriskie
2016-06-23 15:42:36 -06:00
parent 46eee269da
commit 6161754326
2 changed files with 42 additions and 7 deletions
+22
View File
@@ -6,6 +6,28 @@ describe('instance', function () {
afterEach(function () {
jasmine.Ajax.uninstall();
});
it('should have the same methods as default instance', function () {
var instance = axios.create();
for (var prop in axios) {
if (['Axios', 'create', 'all', 'spread'].includes(prop)) {
continue;
}
expect(typeof instance[prop]).toBe(typeof axios[prop]);
}
});
it('should make an http request without verb helper', function (done) {
var instance = axios.create();
instance('/foo');
getAjaxRequest().then(function (request) {
expect(request.url).toBe('/foo');
done();
});
});
it('should make an http request', function (done) {
var instance = axios.create();