mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
@@ -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