2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Adding tests for responseType arraybuffer

This commit is contained in:
mzabriskie
2015-02-02 21:12:08 -07:00
parent d27cef35ba
commit 59093a9c61
2 changed files with 39 additions and 1 deletions
+37
View File
@@ -166,4 +166,41 @@ describe('wrapper', function () {
expect(request.requestHeaders['content-type']).toEqual(undefined);
});
});
// TODO this won't work until karma-jasmine updates to jasmine-ajax 2.99.0
/*
it('should support array buffer response', function () {
var request, response;
runs(function () {
axios({
url: '/foo',
responseType: 'arraybuffer'
}).then(function (data) {
response = data;
});
});
waitsFor(function () {
return request = jasmine.Ajax.requests.mostRecent();
}, 'waiting for the request', 100);
runs(function () {
request.response({
status: 200,
response: new ArrayBuffer(16)
});
request.response = new ArrayBuffer(16);
});
waitsFor(function () {
return response;
}, 'waiting for the response', 100);
runs(function () {
expect(response.data.byteLength).toBe(16);
});
});
*/
});