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

Adding utils tests

This commit is contained in:
mzabriskie
2015-03-17 23:07:32 -06:00
parent a3bf7e981d
commit dfa816df9b
+22 -1
View File
@@ -7,6 +7,27 @@ module.exports = {
test.done();
},
testIsArrayBuffer: function (test) {
test.equals(utils.isArrayBuffer(new ArrayBuffer(2)), true);
test.done();
},
testIsArrayBufferView: function (test) {
test.equals(utils.isArrayBufferView(new DataView(new ArrayBuffer(2))), true);
test.done();
},
// TODO These tests need a browser to run
// testIsFormData: function (test) {
// test.equals(utils.isFormData(new FormData()), true);
// test.done();
// },
//
// testIsBlob: function (test) {
// test.equals(utils.isBlob(new Blob(['<h1>Foo</h1>'], {type: 'text/html'})), true);
// test.done();
// },
testIsString: function (test) {
test.equals(utils.isString(''), true);
test.equals(utils.isString({toString: function () { return ''; }}), false);
@@ -36,4 +57,4 @@ module.exports = {
test.equals(utils.isDate(Date.now()), false);
test.done();
}
};
};