diff --git a/lib/axios.js b/lib/axios.js index 0996d4da..6a6a551e 100644 --- a/lib/axios.js +++ b/lib/axios.js @@ -2,7 +2,6 @@ var defaults = require('./defaults'); var utils = require('./utils'); -var deprecatedMethod = require('./helpers/deprecatedMethod'); var dispatchRequest = require('./core/dispatchRequest'); var InterceptorManager = require('./core/InterceptorManager'); @@ -43,26 +42,6 @@ var axios = module.exports = function axios(config) { promise = promise.then(chain.shift(), chain.shift()); } - // Provide alias for success - promise.success = function success(fn) { - deprecatedMethod('success', 'then', 'https://github.com/mzabriskie/axios/blob/master/README.md#response-api'); - - promise.then(function(response) { - fn(response.data, response.status, response.headers, response.config); - }); - return promise; - }; - - // Provide alias for error - promise.error = function error(fn) { - deprecatedMethod('error', 'catch', 'https://github.com/mzabriskie/axios/blob/master/README.md#response-api'); - - promise.then(null, function(response) { - fn(response.data, response.status, response.headers, response.config); - }); - return promise; - }; - return promise; }; diff --git a/test/specs/api.spec.js b/test/specs/api.spec.js index fbc8e5e3..abfd286b 100644 --- a/test/specs/api.spec.js +++ b/test/specs/api.spec.js @@ -15,8 +15,6 @@ describe('api', function () { expect(typeof promise.then).toEqual('function'); expect(typeof promise.catch).toEqual('function'); - expect(typeof promise.success).toEqual('function'); - expect(typeof promise.error).toEqual('function'); }); it('should have defaults', function () { diff --git a/test/specs/promise.spec.js b/test/specs/promise.spec.js index f15d6264..36b9c64f 100644 --- a/test/specs/promise.spec.js +++ b/test/specs/promise.spec.js @@ -37,37 +37,6 @@ describe('promise', function () { }, 0); }); - it('should provide verbose arguments to success', function (done) { - var request, data, status, headers, config; - - axios({ - url: '/foo' - }).success(function (d, s, h, c) { - data = d; - status = s; - headers = h; - config = c; - fulfilled = true; - }); - - setTimeout(function () { - request = jasmine.Ajax.requests.mostRecent(); - - request.respondWith({ - status: 200, - responseText: '{"hello":"world"}' - }); - - setTimeout(function () { - expect(data.hello).toEqual('world'); - expect(status).toBe(200); - expect(headers['content-type']).toEqual('application/json'); - expect(config.url).toEqual('/foo'); - done(); - }, 0); - }, 0); - }); - it('should support all', function (done) { var fulfilled = false;