2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-27 14:47:43 +03:00

Adding request function to exported singleton

#316
This commit is contained in:
Joshua Egan
2016-05-17 14:54:34 -06:00
committed by Nick Uraltsev
parent 2e949495f0
commit 0d9996b1a0
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -78,7 +78,10 @@ Axios.prototype.request = function request(config) {
var defaultInstance = new Axios(defaults);
var axios = module.exports = bind(Axios.prototype.request, defaultInstance);
module.exports.Axios = Axios;
axios.request = bind(Axios.prototype.request, defaultInstance);
// Expose Axios class to allow class inheritance
axios.Axios = Axios;
// Expose properties from defaultInstance
axios.defaults = defaultInstance.defaults;
+1
View File
@@ -1,5 +1,6 @@
describe('static api', function () {
it('should have request method helpers', function () {
expect(typeof axios.request).toEqual('function');
expect(typeof axios.get).toEqual('function');
expect(typeof axios.head).toEqual('function');
expect(typeof axios.delete).toEqual('function');