Use ok when appropriate in test/test.js.

This commit is contained in:
John-David Dalton
2014-04-06 16:16:39 -07:00
parent a14e2fedcf
commit 77b84c1de0

View File

@@ -483,7 +483,7 @@
test('should not add `Function.prototype` extensions to lodash', 1, function() { test('should not add `Function.prototype` extensions to lodash', 1, function() {
if (lodashBizarro) { if (lodashBizarro) {
strictEqual('_method' in lodashBizarro, false); ok(!('_method' in lodashBizarro));
} }
else { else {
skipTest(); skipTest();
@@ -527,7 +527,7 @@
} catch(e) { } catch(e) {
actual = null; actual = null;
} }
strictEqual(expando in actual, false, message('Object.defineProperty')); ok(!(expando in actual), message('Object.defineProperty'));
try { try {
actual = [lodashBizarro.isPlainObject({}), lodashBizarro.isPlainObject([])]; actual = [lodashBizarro.isPlainObject({}), lodashBizarro.isPlainObject([])];
@@ -1718,7 +1718,7 @@
ok(expando in a); ok(expando in a);
_.createCallback(b, object); _.createCallback(b, object);
strictEqual(expando in b, false); ok(!(expando in b));
if (_.support.funcNames) { if (_.support.funcNames) {
_.support.funcNames = false; _.support.funcNames = false;
@@ -1741,7 +1741,7 @@
if (defineProperty && lodashBizarro) { if (defineProperty && lodashBizarro) {
lodashBizarro.createCallback(a, {}); lodashBizarro.createCallback(a, {});
strictEqual(expando in a, false); ok(!(expando in a));
} }
else { else {
skipTest(); skipTest();
@@ -6067,8 +6067,8 @@
'A': function(string) { return string.toUpperCase(); } 'A': function(string) { return string.toUpperCase(); }
}); });
strictEqual('a' in _, false); ok(!('a' in _));
strictEqual('a' in _.prototype, false); ok(!('a' in _.prototype));
delete _.a; delete _.a;
delete _.prototype.a; delete _.prototype.a;
@@ -6104,7 +6104,7 @@
ok(actual instanceof func, message(func, true)); ok(actual instanceof func, message(func, true));
} else { } else {
strictEqual(actual, 'a', message(func, false)); strictEqual(actual, 'a', message(func, false));
strictEqual(actual instanceof func, false, message(func, false)); ok(!(actual instanceof func), message(func, false));
} }
delete func.a; delete func.a;
delete func.prototype.a; delete func.prototype.a;
@@ -6856,8 +6856,8 @@
delete array[3]; delete array[3];
_.pull(array, 1); _.pull(array, 1);
strictEqual(0 in array, false); ok(!('0' in array));
strictEqual(2 in array, false); ok(!('2' in array));
}); });
test('should treat holes as `undefined`', 1, function() { test('should treat holes as `undefined`', 1, function() {
@@ -7288,8 +7288,8 @@
delete array[3]; delete array[3];
_.remove(array, function(num) { return num === 1; }); _.remove(array, function(num) { return num === 1; });
strictEqual(0 in array, false); ok(!('0' in array));
strictEqual(2 in array, false); ok(!('2' in array));
}); });
test('should treat holes as `undefined`', 1, function() { test('should treat holes as `undefined`', 1, function() {
@@ -8421,10 +8421,10 @@
}); });
test('should not modify `_.templateSettings` when `options` are provided', 2, function() { test('should not modify `_.templateSettings` when `options` are provided', 2, function() {
strictEqual('a' in _.templateSettings, false); ok(!('a' in _.templateSettings));
_.template('', {}, { 'a': 1 }); _.template('', {}, { 'a': 1 });
strictEqual('a' in _.templateSettings, false); ok(!('a' in _.templateSettings));
delete _.templateSettings.a; delete _.templateSettings.a;
}); });
@@ -9762,7 +9762,7 @@
? wrapped[methodName](_.identity) ? wrapped[methodName](_.identity)
: wrapped[methodName](); : wrapped[methodName]();
strictEqual(actual instanceof _, false); ok(!(actual instanceof _));
} }
else { else {
skipTest(); skipTest();