mirror of
https://github.com/tenrok/axios.git
synced 2026-05-24 14:04:14 +03:00
@@ -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 () {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user