提交 dfa816df 编写于 作者: M mzabriskie

Adding utils tests

上级 a3bf7e98
......@@ -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();
}
};
\ No newline at end of file
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册