Add more unit tests to increase coverage.

This commit is contained in:
John-David Dalton
2013-11-29 20:54:18 -06:00
parent 2afbe9514b
commit 97490b272f
2 changed files with 202 additions and 40 deletions

View File

@@ -22,6 +22,9 @@
Array._isArray = Array.isArray;
Array.isArray = function() { return false; };
Date._now = Date.now;
Date.now = function() {};
Function.prototype._bind = Function.prototype.bind;
Function.prototype.bind = function() { return function() {}; };
@@ -34,7 +37,7 @@
Object._keys = Object.keys;
Object.keys = function() { return []; };
// load Lo-Dash and expose it to the bad `Object.keys` shim
// load Lo-Dash and expose it to the bad shims
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
</script>
<script>
@@ -47,6 +50,11 @@
} else {
delete Array.isArray;
}
if (Date._now) {
Date.now = Date._now;
} else {
delete Date.now;
}
if (Function.prototype._bind) {
Function.prototype.bind = Function.prototype._bind;
} else {
@@ -68,6 +76,7 @@
delete Object.keys;
}
delete Array._isArray;
delete Date._now;
delete Function.prototype._bind;
delete Object._create;
delete Object._defineProperty;