mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
Rename axios.createNew to axios.create
This commit is contained in:
@@ -33,12 +33,12 @@ describe('static api', function () {
|
||||
});
|
||||
|
||||
it('should have factory method', function () {
|
||||
expect(typeof axios.createNew).toEqual('function');
|
||||
expect(typeof axios.create).toEqual('function');
|
||||
});
|
||||
});
|
||||
|
||||
describe('instance api', function () {
|
||||
var instance = axios.createNew();
|
||||
var instance = axios.create();
|
||||
|
||||
it('should have request methods', function () {
|
||||
expect(typeof instance.request).toEqual('function');
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('instance', function () {
|
||||
});
|
||||
|
||||
it('should make an http request', function (done) {
|
||||
var instance = axios.createNew();
|
||||
var instance = axios.create();
|
||||
|
||||
instance.request({
|
||||
url: '/foo'
|
||||
@@ -25,7 +25,7 @@ describe('instance', function () {
|
||||
});
|
||||
|
||||
it('should use instance options', function (done) {
|
||||
var instance = axios.createNew({ timeout: 1000 });
|
||||
var instance = axios.create({ timeout: 1000 });
|
||||
|
||||
instance.request({
|
||||
url: '/foo'
|
||||
|
||||
@@ -110,9 +110,9 @@ axios({
|
||||
xsrfHeaderName: 'X-XSRF-TOKEN' // default
|
||||
});
|
||||
|
||||
var instance = axios.createNew();
|
||||
var instance = axios.create();
|
||||
|
||||
axios.createNew({
|
||||
axios.create({
|
||||
transformRequest: (data) => {
|
||||
return data.doSomething();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user