2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Moving test helpers and auto-loading them

This commit is contained in:
Matt Zabriskie
2016-03-07 13:21:27 -07:00
parent 0da38da921
commit dcbb352262
19 changed files with 141 additions and 124 deletions
+23 -4
View File
@@ -7,22 +7,41 @@ describe('utils::isX', function () {
});
it('should validate ArrayBuffer', function () {
// ArrayBuffer doesn't exist in IE8/9
if (isOldIE && typeof ArrayBuffer === 'undefined') {
return;
}
expect(utils.isArrayBuffer(new ArrayBuffer(2))).toEqual(true);
expect(utils.isArrayBuffer({})).toEqual(false);
});
it('should validate ArrayBufferView', function () {
// ArrayBuffer doesn't exist in IE8/9
if (isOldIE && typeof ArrayBuffer === 'undefined') {
return;
}
expect(utils.isArrayBufferView(new DataView(new ArrayBuffer(2)))).toEqual(true);
});
it('should validate FormData', function () {
// FormData doesn't exist in IE8/9
if (isOldIE && typeof FormData === 'undefined') {
return;
}
expect(utils.isFormData(new FormData())).toEqual(true);
});
// TODO Blob is not a constructor in PhantomJS
// it('should validate Blob', function () {
// expect(utils.isBlob(new Blob())).toEqual(true);
// });
it('should validate Blob', function () {
// Blob doesn't exist in IE8/9
if (isOldIE && typeof Blob === 'undefined') {
return;
}
expect(utils.isBlob(new Blob())).toEqual(true);
});
it('should validate String', function () {
expect(utils.isString('')).toEqual(true);