mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
fix(core): fix the Axios constructor implementation to treat the config argument as optional; (#6881)
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ const validators = validator.validators;
|
||||
*/
|
||||
class Axios {
|
||||
constructor(instanceConfig) {
|
||||
this.defaults = instanceConfig;
|
||||
this.defaults = instanceConfig || {};
|
||||
this.interceptors = {
|
||||
request: new InterceptorManager(),
|
||||
response: new InterceptorManager()
|
||||
|
||||
@@ -43,5 +43,11 @@ describe('Axios', function () {
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
it('should not throw if the config argument is omitted', () => {
|
||||
const axios = new Axios();
|
||||
|
||||
assert.deepStrictEqual(axios.defaults, {});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user