We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfe8411 commit 6c5d4cdCopy full SHA for 6c5d4cd
2 files changed
lib/core/Axios.js
@@ -20,7 +20,7 @@ const validators = validator.validators;
20
*/
21
class Axios {
22
constructor(instanceConfig) {
23
- this.defaults = instanceConfig;
+ this.defaults = instanceConfig || {};
24
this.interceptors = {
25
request: new InterceptorManager(),
26
response: new InterceptorManager()
test/unit/core/Axios.js
@@ -43,5 +43,11 @@ describe('Axios', function () {
43
}
44
})
45
});
46
- })
+ });
47
+
48
+ it('should not throw if the config argument is omitted', () => {
49
+ const axios = new Axios();
50
51
+ assert.deepStrictEqual(axios.defaults, {});
52
53
0 commit comments