From bafe4fff9330fade4f3d0fe8df215100bd31cc70 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 28 Sep 2013 18:27:07 -0700 Subject: [PATCH] Update vendor/qunit-clib and validate assert counts in each unit test. --- test/test.js | 798 ++++++++++++++++---------------- vendor/qunit-clib/qunit-clib.js | 33 ++ 2 files changed, 436 insertions(+), 395 deletions(-) diff --git a/test/test.js b/test/test.js index f5b7498ee..e0a5abeca 100644 --- a/test/test.js +++ b/test/test.js @@ -211,7 +211,7 @@ QUnit.module(basename); (function() { - test('supports loading ' + basename + ' as the "lodash" module', function() { + test('supports loading ' + basename + ' as the "lodash" module', 1, function() { if (amd) { equal((lodashModule || {}).moduleName, 'lodash'); } else { @@ -219,7 +219,7 @@ } }); - test('supports loading ' + basename + ' with the Require.js "shim" configuration option', function() { + test('supports loading ' + basename + ' with the Require.js "shim" configuration option', 1, function() { if (amd && /requirejs/.test(ui.loaderPath)) { equal((shimmedModule || {}).moduleName, 'shimmed'); } else { @@ -227,7 +227,7 @@ } }); - test('supports loading ' + basename + ' as the "underscore" module', function() { + test('supports loading ' + basename + ' as the "underscore" module', 1, function() { if (amd && !/dojo/.test(ui.loaderPath)) { equal((underscoreModule || {}).moduleName, 'underscore'); } else { @@ -235,7 +235,7 @@ } }); - asyncTest('supports loading ' + basename + ' in a web worker', function() { + asyncTest('supports loading ' + basename + ' in a web worker', 1, function() { if (Worker && !isModularize) { var limit = 1000, start = new Date; @@ -251,13 +251,14 @@ }; attempt(); - } else { + } + else { skipTest(); QUnit.start(); } }); - test('avoids overwritten native methods', function() { + test('avoids overwritten native methods', 3, function() { function message(methodName) { return '`_.' + methodName + '` should avoid overwritten native methods'; } @@ -291,11 +292,11 @@ QUnit.module('lodash constructor'); (function() { - test('creates a new instance when called without the `new` operator', function() { + test('creates a new instance when called without the `new` operator', 1, function() { ok(_() instanceof _); }); - test('should return provided `lodash` instances', function() { + test('should return provided `lodash` instances', 1,function() { var wrapped = _(false); equal(_(wrapped), wrapped); }); @@ -306,7 +307,7 @@ QUnit.module('lodash.assign'); (function() { - test('should not error on `null` or `undefined` sources (test in IE < 9)', function() { + test('should not error on `null` or `undefined` sources (test in IE < 9)', 1, function() { try { deepEqual(_.assign({}, null, undefined, { 'a': 1 }), { 'a': 1 }); } catch(e) { @@ -322,31 +323,31 @@ (function() { var args = arguments; - test('should return `undefined` for nonexistent keys', function() { + test('should return `undefined` for nonexistent keys', 1, function() { var actual = _.at(['a', 'b', 'c'], [0, 2, 4]); deepEqual(actual, ['a', 'c', undefined]); }); - test('should return an empty array when no keys are provided', function() { + test('should return an empty array when no keys are provided', 1, function() { deepEqual(_.at(['a', 'b', 'c']), []); }); - test('should accept multiple key arguments', function() { + test('should accept multiple key arguments', 1, function() { var actual = _.at(['a', 'b', 'c', 'd'], 0, 2, 3); deepEqual(actual, ['a', 'c', 'd']); }); - test('should work with an `arguments` object for `collection`', function() { + test('should work with an `arguments` object for `collection`', 1, function() { var actual = _.at(args, [0, 2]); deepEqual(actual, ['a', 'c']); }); - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var actual = _.at({ 'a': 1, 'b': 2, 'c': 3 }, ['a', 'c']); deepEqual(actual, [1, 3]); }); - test('should work when used as `callback` for `_.map`', function() { + test('should work when used as `callback` for `_.map`', 1, function() { var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], actual = _.map(array, _.at); @@ -358,7 +359,7 @@ 'object': Object('abc') }, function(collection, key) { - test('should work with a string ' + key + ' for `collection`', function() { + test('should work with a string ' + key + ' for `collection`', 1, function() { deepEqual(_.at(collection, [0, 2]), ['a', 'c']); }); }); @@ -369,7 +370,7 @@ QUnit.module('lodash.bind'); (function() { - test('should append array arguments to partially applied arguments (test in IE < 9)', function() { + test('should append array arguments to partially applied arguments (test in IE < 9)', 1, function() { var args, bound = _.bind(function() { args = slice.call(arguments); }, {}, 'a'); @@ -377,14 +378,14 @@ deepEqual(args, ['a', ['b'], 'c']); }); - test('ensure `new bound` is an instance of `func`', function() { + test('ensure `new bound` is an instance of `func`', 1, function() { var func = function() {}, bound = _.bind(func, {}); ok(new bound instanceof func); }); - test('should throw a TypeError if `func` is not a function', function() { + test('should throw a TypeError if `func` is not a function', 1, function() { raises(function() { _.bind(); }, TypeError); }); }()); @@ -396,7 +397,7 @@ (function() { var args = arguments; - test('should bind all methods of `object`', function() { + test('should bind all methods of `object`', 1, function() { function Foo() { this._a = 1; this._b = 2; @@ -415,7 +416,7 @@ deepEqual(actual, [1, 2]); }); - test('should accept arrays of method names', function() { + test('should accept arrays of method names', 1, function() { var object = { '_a': 1, '_b': 2, @@ -436,13 +437,13 @@ deepEqual(actual, [1, 2, 3, undefined]); }); - test('should work with an array `object` argument', function() { + test('should work with an array `object` argument', 1, function() { var array = ['push', 'pop']; _.bindAll(array); equal(array.pop, Array.prototype.pop); }); - test('should work with `arguments` objects as secondary arguments', function() { + test('should work with `arguments` objects as secondary arguments', 1, function() { var object = { '_a': 1, 'a': function() { return this._a; } @@ -463,7 +464,7 @@ QUnit.module('lodash.bindKey'); (function() { - test('should work when the target function is overwritten', function() { + test('should work when the target function is overwritten', 2, function() { var object = { 'name': 'moe', 'greet': function(greeting) { @@ -487,17 +488,17 @@ QUnit.module('lodash.chain'); (function() { - test('should return a wrapped value', function() { + test('should return a wrapped value', 1, function() { var actual = _.chain({ 'a': 0 }); ok(actual instanceof _); }); - test('should return the existing wrapper when chaining', function() { + test('should return the existing wrapper when chaining', 1, function() { var wrapper = _({ 'a': 0 }); equal(wrapper.chain(), wrapper); }); - test('should enable chaining of methods that return unwrapped values by default', function() { + test('should enable chaining of methods that return unwrapped values by default', 6, function() { var array = ['abc']; ok(_.chain(array).first() instanceof _); @@ -545,7 +546,7 @@ objects['an array'].length = 5; - test('`_.clone` should shallow clone by default', function() { + test('`_.clone` should shallow clone by default', 2, function() { var expected = [{ 'a': 0 }, { 'b': 1 }], actual = _.clone(expected); @@ -553,14 +554,14 @@ ok(actual != expected && actual[0] === expected[0]); }); - test('`_.clone` should perform a shallow clone when used as `callback` for `_.map`', function() { + test('`_.clone` should perform a shallow clone when used as `callback` for `_.map`', 1, function() { var expected = [{ 'a': [0] }, { 'b': [1] }], actual = _.map(expected, _.clone); ok(actual[0] != expected[0] && actual[0].a === expected[0].a && actual[1].b === expected[1].b); }); - test('`_.cloneDeep` should deep clone objects with circular references', function() { + test('`_.cloneDeep` should deep clone objects with circular references', 1, function() { var object = { 'foo': { 'b': { 'foo': { 'c': { } } } }, 'bar': { } @@ -582,7 +583,7 @@ klass = new Klass; _.forOwn(objects, function(object, key) { - test('`_.' + methodName + '` should clone ' + key, function() { + test('`_.' + methodName + '` should clone ' + key, 2, function() { var clone = func(object); strictEqual(_.isEqual(object, clone), true); @@ -595,17 +596,17 @@ }); _.forOwn(nonCloneable, function(object, key) { - test('`_.' + methodName + '` should not clone ' + key, function() { + test('`_.' + methodName + '` should not clone ' + key, 1, function() { strictEqual(func(object), object); }); }); - test('`_.' + methodName + '` should clone problem JScript properties (test in IE < 9)', function() { + test('`_.' + methodName + '` should clone problem JScript properties (test in IE < 9)', 2, function() { deepEqual(func(shadowedObject), shadowedObject); notEqual(func(shadowedObject), shadowedObject); }); - test('`_.' + methodName + '` should pass the correct `callback` arguments', function() { + test('`_.' + methodName + '` should pass the correct `callback` arguments', 1, function() { var args; func(klass, function() { @@ -615,7 +616,7 @@ deepEqual(args, [klass]); }); - test('`_.' + methodName + '` should correct set the `this` binding', function() { + test('`_.' + methodName + '` should correct set the `this` binding', 1, function() { var actual = func('a', function(value) { return this[value]; }, { 'a': 'A' }); @@ -623,12 +624,12 @@ equal(actual, 'A'); }); - test('`_.' + methodName + '` should handle cloning if `callback` returns `undefined`', function() { + test('`_.' + methodName + '` should handle cloning if `callback` returns `undefined`', 1, function() { var actual = func({ 'a': { 'b': 'c' } }, function() {}); deepEqual(actual, { 'a': { 'b': 'c' } }); }); - test('`_.' + methodName + '` should deep clone `index` and `input` array properties', function() { + test('`_.' + methodName + '` should deep clone `index` and `input` array properties', 2, function() { var array = /x/.exec('vwxyz'), actual = func(array); @@ -636,7 +637,7 @@ equal(actual.input, 'vwxyz'); }); - test('`_.' + methodName + '` should deep clone `lastIndex` regexp property', function() { + test('`_.' + methodName + '` should deep clone `lastIndex` regexp property', 1, function() { var regexp = /x/g; regexp.test('vwxyz'); @@ -658,22 +659,22 @@ 'a string': '123123' }, function(collection, key) { - test('should work with ' + key + ' and a positive `fromIndex`', function() { + test('should work with ' + key + ' and a positive `fromIndex`', 1, function() { strictEqual(_.contains(collection, 1, 2), true); }); - test('should work with ' + key + ' and a `fromIndex` >= collection\'s length', function() { + test('should work with ' + key + ' and a `fromIndex` >= collection\'s length', 4, function() { strictEqual(_.contains(collection, 1, 6), false); strictEqual(_.contains(collection, undefined, 6), false); strictEqual(_.contains(collection, 1, 8), false); strictEqual(_.contains(collection, undefined, 8), false); }); - test('should work with ' + key + ' and a negative `fromIndex`', function() { + test('should work with ' + key + ' and a negative `fromIndex`', 1, function() { strictEqual(_.contains(collection, 2, -3), true); }); - test('should work with ' + key + ' and a negative `fromIndex` <= negative collection\'s length', function() { + test('should work with ' + key + ' and a negative `fromIndex` <= negative collection\'s length', 2, function() { strictEqual(_.contains(collection, 1, -6), true); strictEqual(_.contains(collection, 2, -8), true); }); @@ -684,7 +685,7 @@ 'object': Object('abc') }, function(collection, key) { - test('should work with a string ' + key + ' for `collection`', function() { + test('should work with a string ' + key + ' for `collection`', 2, function() { strictEqual(_.contains(collection, 'bc'), true); strictEqual(_.contains(collection, 'd'), false); }); @@ -696,12 +697,12 @@ QUnit.module('lodash.countBy'); (function() { - test('should use `_.identity` when no `callback` is provided', function() { + test('should use `_.identity` when no `callback` is provided', 1, function() { var actual = _.countBy([4, 6, 6]); deepEqual(actual, { '4': 1, '6': 2 }); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.countBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); @@ -709,7 +710,7 @@ deepEqual(actual, { '4': 1, '6': 2 }); }); - test('should only add values to own, not inherited, properties', function() { + test('should only add values to own, not inherited, properties', 2, function() { var actual = _.countBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; }); @@ -718,7 +719,7 @@ deepEqual(actual.hasOwnProperty, 2); }); - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var actual = _.countBy({ 'a': 4.2, 'b': 6.1, 'c': 6.4 }, function(num) { return Math.floor(num); }); @@ -726,7 +727,7 @@ deepEqual(actual, { '4': 1, '6': 2 }); }); - test('should work with a number for `callback`', function() { + test('should work with a number for `callback`', 2, function() { var array = [ [1, 'a'], [2, 'a'], @@ -743,7 +744,7 @@ QUnit.module('lodash.createCallback'); (function() { - test('should work with functions created by `_.partial` and `_.partialRight`', function() { + test('should work with functions created by `_.partial` and `_.partialRight`', 2, function() { function func() { var result = [this.x]; push.apply(result, arguments); @@ -759,7 +760,7 @@ deepEqual(callback(2), expected); }); - test('should work without an `argCount`', function() { + test('should work without an `argCount`', 1, function() { var args, expected = ['a', 'b', 'c', 'd', 'e']; @@ -777,7 +778,7 @@ QUnit.module('lodash.curry'); (function() { - test('should curry based on the number of arguments provided', function() { + test('should curry based on the number of arguments provided', 3, function() { function func(a, b, c) { return a + b + c; } @@ -789,7 +790,7 @@ equal(curried(1, 2, 3), 6); }); - test('should work with partial methods', function() { + test('should work with partial methods', 2, function() { function func(a, b, c) { return a + b + c; } @@ -803,7 +804,7 @@ equal(c(), 6); }); - test('should not alter the `this` binding', function() { + test('should not alter the `this` binding', 9, function() { function func(a, b, c) { var value = this || {}; return value[a] + value[b] + value[c]; @@ -832,7 +833,7 @@ QUnit.module('lodash.debounce'); (function() { - test('subsequent "immediate" debounced calls return the last `func` result', function() { + test('subsequent "immediate" debounced calls return the last `func` result', 1, function() { if (!(isRhino && isModularize)) { var debounced = _.debounce(_.identity, 32, true), result = [debounced('x'), debounced('y')]; @@ -844,7 +845,7 @@ } }); - asyncTest('subsequent debounced calls return the last `func` result', function() { + asyncTest('subsequent debounced calls return the last `func` result', 1, function() { if (!(isRhino && isModularize)) { var debounced = _.debounce(_.identity, 32); debounced('x'); @@ -860,7 +861,7 @@ } }); - asyncTest('should apply default options correctly', function() { + asyncTest('should apply default options correctly', 2, function() { if (!(isRhino && isModularize)) { var count = 0; @@ -882,7 +883,7 @@ } }); - asyncTest('should work with `leading` option', function() { + asyncTest('should work with `leading` option', 7, function() { if (!(isRhino && isModularize)) { var withLeadingAndTrailing, counts = [0, 0, 0]; @@ -917,12 +918,12 @@ }, 64); } else { - skipTest(5); + skipTest(7); QUnit.start(); } }); - asyncTest('should work with `trailing` option', function() { + asyncTest('should work with `trailing` option', 4, function() { if (!(isRhino && isModularize)) { var withCount = 0, withoutCount = 0; @@ -952,7 +953,7 @@ } }); - asyncTest('should work with `maxWait` option', function() { + asyncTest('should work with `maxWait` option', 4, function() { if (!(isRhino && isModularize)) { var limit = 100, withCount = 0, @@ -995,12 +996,12 @@ QUnit.module('lodash.defaults'); (function() { - test('should not overwrite `null` values', function() { + test('should not overwrite `null` values', 1, function() { var actual = _.defaults({ 'a': null }, { 'a': 1 }); strictEqual(actual.a, null); }); - test('should overwrite `undefined` values', function() { + test('should overwrite `undefined` values', 1, function() { var actual = _.defaults({ 'a': undefined }, { 'a': 1 }); strictEqual(actual.a, 1); }); @@ -1011,13 +1012,14 @@ QUnit.module('lodash.defer'); (function() { - asyncTest('should accept additional arguments', function() { + asyncTest('should accept additional arguments', 1, function() { if (!(isRhino && isModularize)) { _.defer(function() { deepEqual(slice.call(arguments), [1, 2, 3]); QUnit.start(); }, 1, 2, 3); - } else { + } + else { skipTest(); QUnit.start(); } @@ -1029,7 +1031,7 @@ QUnit.module('lodash.difference'); (function() { - test('should work with large arrays', function() { + test('should work with large arrays', 1, function() { var array1 = _.range(largeArraySize), array2 = array1.slice(), a = {}, @@ -1042,7 +1044,7 @@ deepEqual(_.difference(array1, array2), []); }); - test('should not accept individual secondary values', function() { + test('should not accept individual secondary values', 1, function() { var array = [1, null, 3]; deepEqual(_.difference(array, null, 3), array); }); @@ -1053,15 +1055,15 @@ QUnit.module('lodash.escape'); (function() { - test('should not escape the "/" character', function() { + test('should not escape the "/" character', 1, function() { equal(_.escape('/'), '/'); }); - test('should escape "\'" to "'"', function() { + test('should escape "\'" to "'"', 1, function() { equal(_.escape("'"), "'"); }); - test('should return an empty string when provided `null` or `undefined`', function() { + test('should return an empty string when provided `null` or `undefined`', 2, function() { equal(_.escape(null), ''); equal(_.escape(undefined), ''); }); @@ -1072,7 +1074,7 @@ QUnit.module('lodash.every'); (function() { - test('should return `false` as soon as the `callback` result is falsey', function() { + test('should return `false` as soon as the `callback` result is falsey', 1, function() { strictEqual(_.every([true, null, true], _.identity), false); }); }()); @@ -1084,13 +1086,13 @@ _.forEach(['assign', 'defaults', 'merge'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` should not assign inherited `source` properties', function() { + test('`_.' + methodName + '` should not assign inherited `source` properties', 1, function() { function Foo() {} Foo.prototype = { 'a': 1 }; deepEqual(func({}, new Foo), {}); }); - test('should work when used as `callback` for `_.reduce`', function() { + test('should work when used as `callback` for `_.reduce`', 1, function() { var array = [{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }], actual = _.reduce(array, _.merge); @@ -1098,7 +1100,7 @@ }); if (methodName == 'merge') { - test('`_.' + methodName + '` should treat sparse arrays as dense', function() { + test('`_.' + methodName + '` should treat sparse arrays as dense', 2, function() { var array = Array(3); array[0] = 1; array[2] = 3; @@ -1121,7 +1123,7 @@ _.forEach(['assign', 'bindAll', 'defaults'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` should not throw strict mode errors', function() { + test('`_.' + methodName + '` should not throw strict mode errors', 1, function() { var object = { 'a': null, 'b': function(){} }, pass = true; @@ -1149,7 +1151,7 @@ QUnit.module('lodash.filter'); (function() { - test('should not modify the resulting value from within `callback`', function() { + test('should not modify the resulting value from within `callback`', 1, function() { var actual = _.filter([0], function(num, index, array) { return (array[index] = 1); }); @@ -1180,23 +1182,23 @@ var func = _[methodName]; - test('should return the correct value', function() { + test('should return the correct value', 1, function() { strictEqual(func(objects, function(object) { return object.a; }), expected[0]); }); - test('should work with a `thisArg`', function() { + test('should work with a `thisArg`', 1, function() { strictEqual(func(objects, function(object, index) { return this[index].a; }, objects), expected[0]); }); - test('should return `' + expected[1] + '` if value is not found', function() { + test('should return `' + expected[1] + '` if value is not found', 1, function() { strictEqual(func(objects, function(object) { return object.a == 3; }), expected[1]); }); - test('should work with an object for `callback`', function() { + test('should work with an object for `callback`', 1, function() { strictEqual(func(objects, { 'b': 2 }), expected[2]); }); - test('should work with a string for `callback`', function() { + test('should work with a string for `callback`', 1, function() { strictEqual(func(objects, 'b'), expected[3]); }); }); @@ -1215,38 +1217,38 @@ { 'a': 0, 'b': 0 } ]; - test('should return the first element', function() { + test('should return the first element', 1, function() { strictEqual(_.first(array), 1); }); - test('should return the first two elements', function() { + test('should return the first two elements', 1, function() { deepEqual(_.first(array, 2), [1, 2]); }); - test('should return an empty array when `n` < `1`', function() { + test('should return an empty array when `n` < `1`', 3, function() { _.each([0, -1, -2], function(n) { deepEqual(_.first(array, n), []); }); }); - test('should return all elements when `n` >= `array.length`', function() { + test('should return all elements when `n` >= `array.length`', 2, function() { _.each([3, 4], function(n) { deepEqual(_.first(array, n), array.slice()); }); }); - test('should return `undefined` when querying empty arrays', function() { + test('should return `undefined` when querying empty arrays', 1, function() { strictEqual(_.first([]), undefined); }); - test('should work when used as `callback` for `_.map`', function() { + test('should work when used as `callback` for `_.map`', 1, function() { var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], actual = _.map(array, _.first); deepEqual(actual, [1, 4, 7]); }); - test('should work with a `callback`', function() { + test('should work with a `callback`', 1, function() { var actual = _.first(array, function(num) { return num < 3; }); @@ -1254,7 +1256,7 @@ deepEqual(actual, [1, 2]); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args; _.first(array, function() { @@ -1264,7 +1266,7 @@ deepEqual(args, [1, 0, array]); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.first(array, function(num, index) { return this[index] < 3; }, array); @@ -1272,7 +1274,7 @@ deepEqual(actual, [1, 2]); }); - test('should chain when passing `n`, `callback`, or `thisArg`', function() { + test('should chain when passing `n`, `callback`, or `thisArg`', 3, function() { var actual = _(array).first(2); ok(actual instanceof _); @@ -1290,16 +1292,16 @@ ok(actual instanceof _); }); - test('should not chain when arguments are not provided', function() { + test('should not chain when arguments are not provided', 1, function() { var actual = _(array).first(); strictEqual(actual, 1); }); - test('should work with an object for `callback`', function() { + test('should work with an object for `callback`', 1, function() { deepEqual(_.first(objects, { 'b': 2 }), objects.slice(0, 1)); }); - test('should work with a string for `callback`', function() { + test('should work with a string for `callback`', 1, function() { deepEqual(_.first(objects, 'b'), objects.slice(0, 2)); }); }()); @@ -1312,12 +1314,12 @@ var args = arguments, array = [{ 'a': [1, [2]] }, { 'a': [3] }]; - test('should flatten `arguments` objects', function() { + test('should flatten `arguments` objects', 1, function() { var actual = _.flatten([args, args]); deepEqual(actual, [1, 2, 3, 1, 2, 3]); }); - test('should work with a `callback`', function() { + test('should work with a `callback`', 1, function() { var actual = _.flatten(array, function(object) { return object.a; }); @@ -1325,7 +1327,7 @@ deepEqual(actual, [1, 2, 3]); }); - test('should work with `isShallow` and `callback`', function() { + test('should work with `isShallow` and `callback`', 1, function() { var actual = _.flatten(array, true, function(object) { return object.a; }); @@ -1333,7 +1335,7 @@ deepEqual(actual, [1, [2], 3]); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args; _.flatten(array, function() { @@ -1343,7 +1345,7 @@ deepEqual(args, [{ 'a': [1, [2]] }, 0, array]); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.flatten(array, function(object, index) { return this[index].a; }, array); @@ -1351,18 +1353,18 @@ deepEqual(actual, [1, 2, 3]); }); - test('should work with a string for `callback`', function() { + test('should work with a string for `callback`', 1, function() { deepEqual(_.flatten(array, 'a'), [1, 2, 3]); }); - test('should perform a deep flatten when used as `callback` for `_.map`', function() { + test('should perform a deep flatten when used as `callback` for `_.map`', 1, function() { var array = [[[['a']]], [[['b']]]], actual = _.map(array, _.flatten); deepEqual(actual, [['a'], ['b']]); }); - test('should treat sparse arrays as dense', function() { + test('should treat sparse arrays as dense', 4, function() { var array = [[1, 2, 3], Array(3)], expected = [1, 2, 3], actual1 = _.flatten(array), @@ -1377,7 +1379,7 @@ ok(4 in actual2); }); - test('should work with extremely large arrays', function() { + test('should work with extremely large arrays', 1, function() { var expected = Array(5e5), pass = true; @@ -1397,7 +1399,7 @@ } }); - test('should work with empty arrays', function() { + test('should work with empty arrays', 1, function() { var actual = _.flatten([[], [[]], [[], [[[]]]]]); deepEqual(actual, []); }); @@ -1410,17 +1412,17 @@ _.forEach(['forEach', 'forEachRight'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` should return the collection', function() { + test('`_.' + methodName + '` should return the collection', 1, function() { var collection = [1, 2, 3]; equal(func(collection, Boolean), collection); }); - test('`_.' + methodName + '` should return the existing wrapper when chaining', function() { + test('`_.' + methodName + '` should return the existing wrapper when chaining', 1, function() { var wrapper = _([1, 2, 3]); equal(wrapper[methodName](Boolean), wrapper); }); - test('`_.' + methodName + '` should support the `thisArg` argument', function() { + test('`_.' + methodName + '` should support the `thisArg` argument', 2, function() { var actual; function callback(num, index) { @@ -1439,7 +1441,7 @@ 'object': Object('abc') }, function(collection, key) { - test('`_.' + methodName + '` should work with a string ' + key + ' for `collection` (test in IE < 9)', function() { + test('`_.' + methodName + '` should work with a string ' + key + ' for `collection` (test in IE < 9)', 2, function() { var args, values = []; @@ -1466,7 +1468,7 @@ _.forEach(['forIn', 'forInRight'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` iterates over inherited properties', function() { + test('`_.' + methodName + '` iterates over inherited properties', 1, function() { function Foo() { this.a = 1; } Foo.prototype.b = 2; @@ -1475,7 +1477,7 @@ deepEqual(keys.sort(), ['a', 'b']); }); - test('`_.' + methodName + '` fixes the JScript [[DontEnum]] bug with inherited properties (test in IE < 9)', function() { + test('`_.' + methodName + '` fixes the JScript [[DontEnum]] bug with inherited properties (test in IE < 9)', 1, function() { function Foo() {} Foo.prototype = shadowedObject; @@ -1496,7 +1498,7 @@ _.forEach(['forOwn', 'forOwnRight'], function(methodName) { var func = _[methodName]; - test('iterates over the `length` property', function() { + test('iterates over the `length` property', 1, function() { var object = { '0': 'zero', '1': 'one', 'length': 2 }, props = []; @@ -1512,13 +1514,13 @@ _.forEach(['forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { + test('`_.' + methodName + '` fixes the JScript [[DontEnum]] bug (test in IE < 9)', 1, function() { var props = []; func(shadowedObject, function(value, prop) { props.push(prop); }); deepEqual(props.sort(), shadowedProps); }); - test('`_.' + methodName + '` does not iterate over non-enumerable properties (test in IE < 9)', function() { + test('`_.' + methodName + '` does not iterate over non-enumerable properties (test in IE < 9)', 10, function() { _.forOwn({ 'Array': Array.prototype, 'Boolean': Boolean.prototype, @@ -1548,7 +1550,7 @@ }); }); - test('`_.' + methodName + '` skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { + test('`_.' + methodName + '` skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', 2, function() { function Foo() {} Foo.prototype.a = 1; @@ -1572,13 +1574,13 @@ _.forEach(['assign', 'defaults', 'merge'], function(methodName) { var func = _[methodName]; - test('should return the existing wrapper when chaining', function() { + test('should return the existing wrapper when chaining', 1, function() { var wrapper = _({ 'a': 1 }); equal(wrapper[methodName]({ 'b': 2 }), wrapper); }); - test('`_.' + methodName + '` should assign problem JScript properties (test in IE < 9)', function() { + test('`_.' + methodName + '` should assign problem JScript properties (test in IE < 9)', 1, function() { var object = { 'constructor': '0', 'hasOwnProperty': '1', @@ -1599,7 +1601,7 @@ deepEqual(func(object, source), shadowedObject); }); - test('`_.' + methodName + '` skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { + test('`_.' + methodName + '` skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', 2, function() { function Foo() {} Foo.prototype.c = 3; @@ -1613,7 +1615,7 @@ deepEqual(func({}, Foo), expected); }); - test('`_.' + methodName + '` should work with `_.reduce`', function() { + test('`_.' + methodName + '` should work with `_.reduce`', 1, function() { var actual = { 'a': 1}, array = [{ 'b': 2 }, { 'c': 3 }]; @@ -1625,7 +1627,7 @@ _.forEach(['assign', 'merge'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` should pass the correct `callback` arguments', function() { + test('`_.' + methodName + '` should pass the correct `callback` arguments', 2, function() { var args; func({ 'a': 1 }, { 'a': 2 }, function() { args || (args = slice.call(arguments)); @@ -1644,7 +1646,7 @@ deepEqual(args, [array, object], 'non-primitive property values'); }); - test('`_.' + methodName + '` should correct set the `this` binding', function() { + test('`_.' + methodName + '` should correct set the `this` binding', 1, function() { var actual = func({}, { 'a': 0 }, function(a, b) { return this[b]; }, [2]); @@ -1652,7 +1654,7 @@ deepEqual(actual, { 'a': 2 }); }); - test('`_.' + methodName + '` should not treat the second argument as a `callback`', function() { + test('`_.' + methodName + '` should not treat the second argument as a `callback`', 2, function() { function callback() {} callback.b = 2; @@ -1671,7 +1673,7 @@ _.forEach(['forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` can exit early when iterating arrays', function() { + test('`_.' + methodName + '` can exit early when iterating arrays', 1, function() { var array = [1, 2, 3], values = []; @@ -1679,7 +1681,7 @@ deepEqual(values, [/Right/.test(methodName) ? 3 : 1]); }); - test('`_.' + methodName + '` can exit early when iterating objects', function() { + test('`_.' + methodName + '` can exit early when iterating objects', 1, function() { var object = { 'a': 1, 'b': 2, 'c': 3 }, values = []; @@ -1701,14 +1703,14 @@ return count % 2 ? stringObject : stringLiteral; }); - test('internal data objects should work with the `__proto__` key', function() { + test('internal data objects should work with the `__proto__` key', 4, function() { deepEqual(_.difference(array, array), []); deepEqual(_.intersection(array, array), expected); deepEqual(_.uniq(array), expected); deepEqual(_.without.apply(_, [array].concat(array)), []); }); - test('lodash.memoize should memoize values resolved to the `__proto__` key', function() { + test('lodash.memoize should memoize values resolved to the `__proto__` key', 1, function() { var count = 0, memoized = _.memoize(function() { return ++count; }); @@ -1723,12 +1725,12 @@ QUnit.module('lodash.groupBy'); (function() { - test('should use `_.identity` when no `callback` is provided', function() { + test('should use `_.identity` when no `callback` is provided', 1, function() { var actual = _.groupBy([4, 6, 6]); deepEqual(actual, { '4': [4], '6': [6, 6] }); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); @@ -1736,7 +1738,7 @@ deepEqual(actual, { '4': [4.2], '6': [6.1, 6.4] }); }); - test('should only add values to own, not inherited, properties', function() { + test('should only add values to own, not inherited, properties', 2, function() { var actual = _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; }); @@ -1745,7 +1747,7 @@ deepEqual(actual.hasOwnProperty, [6.1, 6.4]); }); - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var actual = _.groupBy({ 'a': 4.2, 'b': 6.1, 'c': 6.4 }, function(num) { return Math.floor(num); }); @@ -1753,7 +1755,7 @@ deepEqual(actual, { '4': [4.2], '6': [6.1, 6.4] }); }); - test('should work with a number for `callback`', function() { + test('should work with a number for `callback`', 2, function() { var array = [ [1, 'a'], [2, 'a'], @@ -1770,12 +1772,12 @@ QUnit.module('lodash.indexBy'); (function() { - test('should use `_.identity` when no `callback` is provided', function() { + test('should use `_.identity` when no `callback` is provided', 1, function() { var actual = _.indexBy([4, 6, 6]); deepEqual(actual, { '4': 4, '6': 6 }); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.indexBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); @@ -1783,7 +1785,7 @@ deepEqual(actual, { '4': 4.2, '6': 6.4 }); }); - test('should only add values to own, not inherited, properties', function() { + test('should only add values to own, not inherited, properties', 2, function() { var actual = _.indexBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; }); @@ -1792,7 +1794,7 @@ deepEqual(actual.hasOwnProperty, 6.4); }); - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var actual = _.indexBy({ 'a': 4.2, 'b': 6.1, 'c': 6.4 }, function(num) { return Math.floor(num); }); @@ -1800,7 +1802,7 @@ deepEqual(actual, { '4': 4.2, '6': 6.4 }); }); - test('should work with a number for `callback`', function() { + test('should work with a number for `callback`', 2, function() { var array = [ [1, 'a'], [2, 'a'], @@ -1817,7 +1819,7 @@ QUnit.module('lodash.has'); (function() { - test('should return `false` for primitives', function() { + test('should return `false` for primitives', 9, function() { _.forEach(falsey.concat(1, 'a'), function(value) { strictEqual(_.has(value, 'valueOf'), false); }); @@ -1831,31 +1833,31 @@ (function() { var array = [1, 2, 3, 1, 2, 3]; - test('should work with a positive `fromIndex`', function() { + test('should work with a positive `fromIndex`', 1, function() { equal(_.indexOf(array, 1, 2), 3); }); - test('should work with `fromIndex` >= `array.length`', function() { + test('should work with `fromIndex` >= `array.length`', 4, function() { equal(_.indexOf(array, 1, 6), -1); equal(_.indexOf(array, undefined, 6), -1); equal(_.indexOf(array, 1, 8), -1); equal(_.indexOf(array, undefined, 8), -1); }); - test('should work with a negative `fromIndex`', function() { + test('should work with a negative `fromIndex`', 1, function() { equal(_.indexOf(array, 2, -3), 4); }); - test('should work with a negative `fromIndex` <= `-array.length`', function() { + test('should work with a negative `fromIndex` <= `-array.length`', 2, function() { strictEqual(_.indexOf(array, 1, -6), 0); strictEqual(_.indexOf(array, 2, -8), 1); }); - test('should ignore non-number `fromIndex` values', function() { + test('should ignore non-number `fromIndex` values', 1, function() { strictEqual(_.indexOf([1, 2, 3], 1, '1'), 0); }); - test('should work with `isSorted`', function() { + test('should work with `isSorted`', 1, function() { strictEqual(_.indexOf([1, 2, 3], 1, true), 0); }); }()); @@ -1885,47 +1887,51 @@ var array = [1, new Foo, 3, new Foo], indexOf = _.indexOf; - test('`_.contains` should work with a custom `_.indexOf` method', function() { + test('`_.contains` should work with a custom `_.indexOf` method', 1, function() { if (!isModularize) { _.indexOf = custom; ok(_.contains(array, new Foo)); _.indexOf = indexOf; - } else { + } + else { skipTest(); } }); - test('`_.difference` should work with a custom `_.indexOf` method', function() { + test('`_.difference` should work with a custom `_.indexOf` method', 1, function() { if (!isModularize) { _.indexOf = custom; deepEqual(_.difference(array, [new Foo]), [1, 3]); _.indexOf = indexOf; - } else { + } + else { skipTest(); } }); - test('`_.intersection` should work with a custom `_.indexOf` method', function() { + test('`_.intersection` should work with a custom `_.indexOf` method', 1, function() { if (!isModularize) { _.indexOf = custom; deepEqual(_.intersection(array, [new Foo]), [array[1]]); _.indexOf = indexOf; - } else { + } + else { skipTest(); } }); - test('`_.omit` should work with a custom `_.indexOf` method', function() { + test('`_.omit` should work with a custom `_.indexOf` method', 1, function() { if (!isModularize) { _.indexOf = custom; deepEqual(_.omit(array, ['x']), { '0': 1, '2': 3 }); _.indexOf = indexOf; - } else { + } + else { skipTest(); } }); - test('`_.uniq` should work with a custom `_.indexOf` method', function() { + test('`_.uniq` should work with a custom `_.indexOf` method', 2, function() { if (!isModularize) { _.indexOf = custom; deepEqual(_.uniq(array), array.slice(0, 3)); @@ -1936,7 +1942,8 @@ deepEqual(_.uniq(largeArray), [largeArray[0]]); _.indexOf = indexOf; - } else { + } + else { skipTest(2); } }); @@ -1955,7 +1962,7 @@ { 'a': 2, 'b': 2 } ]; - test('should accept a falsey `array` argument', function() { + test('should accept a falsey `array` argument', 7, function() { _.forEach(falsey, function(index, value) { try { var actual = index ? _.initial(value) : _.initial(); @@ -1964,38 +1971,38 @@ }) }); - test('should exclude last element', function() { + test('should exclude last element', 1, function() { deepEqual(_.initial(array), [1, 2]); }); - test('should exclude the last two elements', function() { + test('should exclude the last two elements', 1, function() { deepEqual(_.initial(array, 2), [1]); }); - test('should return an empty when querying empty arrays', function() { + test('should return an empty when querying empty arrays', 1, function() { deepEqual(_.initial([]), []); }); - test('should return all elements when `n` < `1`', function() { + test('should return all elements when `n` < `1`', 3, function() { _.each([0, -1, -2], function(n) { deepEqual(_.initial(array, n), array.slice()); }); }); - test('should return an empty array when `n` >= `array.length`', function() { + test('should return an empty array when `n` >= `array.length`', 2, function() { _.each([3, 4], function(n) { deepEqual(_.initial(array, n), []); }); }); - test('should work when used as `callback` for `_.map`', function() { + test('should work when used as `callback` for `_.map`', 1, function() { var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], actual = _.map(array, _.initial); deepEqual(actual, [[1, 2], [4, 5], [7, 8]]); }); - test('should work with a `callback`', function() { + test('should work with a `callback`', 1, function() { var actual = _.initial(array, function(num) { return num > 1; }); @@ -2003,7 +2010,7 @@ deepEqual(actual, [1]); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args; _.initial(array, function() { @@ -2013,7 +2020,7 @@ deepEqual(args, [3, 2, array]); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.initial(array, function(num, index) { return this[index] > 1; }, array); @@ -2021,11 +2028,11 @@ deepEqual(actual, [1]); }); - test('should work with an object for `callback`', function() { + test('should work with an object for `callback`', 1, function() { deepEqual(_.initial(objects, { 'b': 2 }), objects.slice(0, 2)); }); - test('should work with a string for `callback`', function() { + test('should work with a string for `callback`', 1, function() { deepEqual(_.initial(objects, 'b'), objects.slice(0, 1)); }); }()); @@ -2035,7 +2042,7 @@ QUnit.module('lodash.invoke'); (function() { - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var object = { 'a': 1, 'b': 2, 'c': 3 }; deepEqual(_.invoke(object, 'toFixed', 1), ['1.0', '2.0', '3.0']); }); @@ -2046,10 +2053,10 @@ QUnit.module('lodash.isElement'); (function() { - test('should use strict equality in its duck type check', function() { + test('should use strict equality in its duck type check', 6, function() { var element = body || { 'nodeType': 1 }; - strictEqual(_.isElement(element), true); + strictEqual(_.isElement(element), true); strictEqual(_.isElement({ 'nodeType': new Number(1) }), false); strictEqual(_.isElement({ 'nodeType': true }), false); strictEqual(_.isElement({ 'nodeType': [1] }), false); @@ -2065,11 +2072,11 @@ (function() { var args = arguments; - test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { + test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', 1, function() { equal(_.isEmpty(shadowedObject), false); }); - test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { + test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', 2, function() { function Foo() {} Foo.prototype.a = 1; strictEqual(_.isEmpty(Foo), true); @@ -2078,18 +2085,18 @@ strictEqual(_.isEmpty(Foo), true); }); - test('should work with an object that has a `length` property', function() { + test('should work with an object that has a `length` property', 1, function() { strictEqual(_.isEmpty({ 'length': 0 }), false); }); - test('should work with jQuery/MooTools DOM query collections', function() { + test('should work with jQuery/MooTools DOM query collections', 1, function() { function Foo(elements) { push.apply(this, elements); } Foo.prototype = { 'length': 0, 'splice': Array.prototype.splice }; strictEqual(_.isEmpty(new Foo([])), true); }); - test('should work with `arguments` objects (test in IE < 9)', function() { + test('should work with `arguments` objects (test in IE < 9)', 1, function() { if (!isPhantomPage) { strictEqual(_.isEmpty(args), false); } else { @@ -2103,7 +2110,7 @@ QUnit.module('lodash.isEqual'); (function() { - test('should work with `arguments` objects (test in IE < 9)', function() { + test('should work with `arguments` objects (test in IE < 9)', 2, function() { var args1 = (function() { return arguments; }(1, 2, 3)), args2 = (function() { return arguments; }(1, 2, 3)), args3 = (function() { return arguments; }(1, 2)); @@ -2116,11 +2123,11 @@ } }); - test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { + test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', 1, function() { strictEqual(_.isEqual(shadowedObject, {}), false); }); - test('should return `true` for like-objects from different documents', function() { + test('should return `true` for like-objects from different documents', 1, function() { // ensure `_._object` is assigned (unassigned in Opera 10.00) if (_._object) { var object = { 'a': 1, 'b': 2, 'c': 3 }; @@ -2130,7 +2137,7 @@ } }); - test('should return `false` when comparing values with circular references to unlike values', function() { + test('should return `false` when comparing values with circular references to unlike values', 2, function() { var array1 = ['a', null, 'c'], array2 = ['a', [], 'c'], object1 = { 'a': 1, 'b': null, 'c': 3 }, @@ -2143,7 +2150,7 @@ strictEqual(_.isEqual(object1, object2), false); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args; _.isEqual('a', 'b', function() { @@ -2153,7 +2160,7 @@ deepEqual(args, ['a', 'b']); }); - test('should correct set the `this` binding', function() { + test('should correct set the `this` binding', 1, function() { var actual = _.isEqual('a', 'b', function(a, b) { return this[a] == this[b]; }, { 'a': 1, 'b': 1 }); @@ -2161,12 +2168,12 @@ strictEqual(actual, true); }); - test('should handle comparisons if `callback` returns `undefined`', function() { + test('should handle comparisons if `callback` returns `undefined`', 1, function() { var actual = _.isEqual('a', 'a', function() {}); strictEqual(actual, true); }); - test('should return a boolean value even if `callback` does not', function() { + test('should return a boolean value even if `callback` does not', 8, function() { var actual = _.isEqual('a', 'a', function() { return 'a'; }); strictEqual(actual, true); @@ -2176,7 +2183,7 @@ }); }); - test('should ensure `callback` is a function', function() { + test('should ensure `callback` is a function', 1, function() { var array = [1, 2, 3], eq = _.partial(_.isEqual, array), actual = _.every([array, [1, 0, 3]], eq); @@ -2190,7 +2197,7 @@ QUnit.module('lodash.isFinite'); (function() { - test('should return `false` for non-numeric values', function() { + test('should return `false` for non-numeric values', 6, function() { strictEqual(_.isFinite(null), false); strictEqual(_.isFinite([]), false); strictEqual(_.isFinite(true), false); @@ -2199,7 +2206,7 @@ strictEqual(_.isFinite('2px'), false); }); - test('should return `true` for numeric string values', function() { + test('should return `true` for numeric string values', 3, function() { strictEqual(_.isFinite('2'), true); strictEqual(_.isFinite('0'), true); strictEqual(_.isFinite('08'), true); @@ -2211,7 +2218,7 @@ QUnit.module('lodash.isObject'); (function() { - test('should avoid V8 bug #2291', function() { + test('should avoid V8 bug #2291', 1, function() { // trigger V8 bug // http://code.google.com/p/v8/issues/detail?id=2291 var obj = {}, @@ -2231,7 +2238,7 @@ QUnit.module('lodash.isNaN'); (function() { - test('returns `true` for `new Number(NaN)`', function() { + test('returns `true` for `new Number(NaN)`', 1, function() { strictEqual(_.isNaN(new Number(NaN)), true); }); }()); @@ -2241,7 +2248,7 @@ QUnit.module('lodash.isNumber'); (function() { - test('should avoid `[xpconnect wrapped native prototype]` in Firefox', function() { + test('should avoid `[xpconnect wrapped native prototype]` in Firefox', 1, function() { strictEqual(_.isNumber(+"2"), true); }); }()); @@ -2251,7 +2258,7 @@ QUnit.module('lodash.isPlainObject'); (function() { - test('should detect plain objects', function() { + test('should detect plain objects', 5, function() { function Foo(a) { this.a = 1; } @@ -2272,11 +2279,11 @@ } }); - test('should return `true` for empty objects', function() { + test('should return `true` for empty objects', 1, function() { strictEqual(_.isPlainObject({}), true); }); - test('should return `false` for Object objects without a [[Class]] of "Object"', function() { + test('should return `false` for Object objects without a [[Class]] of "Object"', 4, function() { strictEqual(_.isPlainObject(arguments), false); strictEqual(_.isPlainObject(Error), false); strictEqual(_.isPlainObject(Math), false); @@ -2309,7 +2316,7 @@ function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` should return a boolean', function() { + test('`_.' + methodName + '` should return a boolean', 15, function() { var expected = 'boolean'; equal(typeof func(arguments), expected); @@ -2331,7 +2338,7 @@ }); (function() { - test('should return `false` for subclassed values', function() { + test('should return `false` for subclassed values', 7, function() { _.forEach(['isArray', 'isBoolean', 'isDate', 'isFunction', 'isNumber', 'isRegExp', 'isString'], function(methodName) { function Foo() {} Foo.prototype = root[methodName.slice(2)].prototype; @@ -2353,7 +2360,7 @@ (function() { var args = arguments; - test('should work with `arguments` objects (test in IE < 9)', function() { + test('should work with `arguments` objects (test in IE < 9)', 1, function() { if (!isPhantomPage) { deepEqual(_.keys(args), ['0', '1', '2']); } else { @@ -2361,7 +2368,7 @@ } }); - test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { + test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', 2, function() { function Foo() {} Foo.prototype.a = 1; @@ -2369,7 +2376,7 @@ deepEqual(_.keys(shadowedObject).sort(), shadowedProps); }); - test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { + test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', 2, function() { function Foo() {} Foo.prototype.c = 3; @@ -2397,38 +2404,38 @@ { 'a': 2, 'b': 2 } ]; - test('should return the last element', function() { + test('should return the last element', 1, function() { equal(_.last(array), 3); }); - test('should return the last two elements', function() { + test('should return the last two elements', 1, function() { deepEqual(_.last(array, 2), [2, 3]); }); - test('should return an empty array when `n` < `1`', function() { + test('should return an empty array when `n` < `1`', 3, function() { _.each([0, -1, -2], function(n) { deepEqual(_.last(array, n), []); }); }); - test('should return all elements when `n` >= `array.length`', function() { + test('should return all elements when `n` >= `array.length`', 2, function() { _.each([3, 4], function(n) { deepEqual(_.last(array, n), array.slice()); }); }); - test('should return `undefined` when querying empty arrays', function() { + test('should return `undefined` when querying empty arrays', 1, function() { strictEqual(_.last([]), undefined); }); - test('should work when used as `callback` for `_.map`', function() { + test('should work when used as `callback` for `_.map`', 1, function() { var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], actual = _.map(array, _.last); deepEqual(actual, [3, 6, 9]); }); - test('should work with a `callback`', function() { + test('should work with a `callback`', 1, function() { var actual = _.last(array, function(num) { return num > 1; }); @@ -2436,7 +2443,7 @@ deepEqual(actual, [2, 3]); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args; _.last(array, function() { @@ -2446,7 +2453,7 @@ deepEqual(args, [3, 2, array]); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.last(array, function(num, index) { return this[index] > 1; }, array); @@ -2454,7 +2461,7 @@ deepEqual(actual, [2, 3]); }); - test('should chain when passing `n`, `callback`, or `thisArg`', function() { + test('should chain when passing `n`, `callback`, or `thisArg`', 3, function() { var actual = _(array).last(2); ok(actual instanceof _); @@ -2472,16 +2479,16 @@ ok(actual instanceof _); }); - test('should not chain when arguments are not provided', function() { + test('should not chain when arguments are not provided', 1, function() { var actual = _(array).last(); equal(actual, 3); }); - test('should work with an object for `callback`', function() { + test('should work with an object for `callback`', 1, function() { deepEqual(_.last(objects, { 'b': 2 }), objects.slice(-1)); }); - test('should work with a string for `callback`', function() { + test('should work with a string for `callback`', 1, function() { deepEqual(_.last(objects, 'b'), objects.slice(-2)); }); }()); @@ -2493,27 +2500,27 @@ (function() { var array = [1, 2, 3, 1, 2, 3]; - test('should work with a positive `fromIndex`', function() { + test('should work with a positive `fromIndex`', 1, function() { strictEqual(_.lastIndexOf(array, 1, 2), 0); }); - test('should work with `fromIndex` >= `array.length`', function() { + test('should work with `fromIndex` >= `array.length`', 4, function() { equal(_.lastIndexOf(array, undefined, 6), -1); equal(_.lastIndexOf(array, 1, 6), 3); equal(_.lastIndexOf(array, undefined, 8), -1); equal(_.lastIndexOf(array, 1, 8), 3); }); - test('should work with a negative `fromIndex`', function() { + test('should work with a negative `fromIndex`', 1, function() { strictEqual(_.lastIndexOf(array, 2, -3), 1); }); - test('should work with a negative `fromIndex` <= `-array.length`', function() { + test('should work with a negative `fromIndex` <= `-array.length`', 2, function() { strictEqual(_.lastIndexOf(array, 1, -6), 0); equal(_.lastIndexOf(array, 2, -8), -1); }); - test('should ignore non-number `fromIndex` values', function() { + test('should ignore non-number `fromIndex` values', 2, function() { equal(_.lastIndexOf([1, 2, 3], 3, '1'), 2); equal(_.lastIndexOf([1, 2, 3], 3, true), 2); }); @@ -2524,12 +2531,12 @@ QUnit.module('lodash.map'); (function() { - test('should return the correct result when iterating an object', function() { + test('should return the correct result when iterating an object', 1, function() { var actual = _.map({ 'a': 1, 'b': 2, 'c': 3 }); deepEqual(actual, [1, 2, 3]); }); - test('should handle object arguments with non-numeric length properties', function() { + test('should handle object arguments with non-numeric length properties', 1, function() { if (defineProperty) { var object = {}; defineProperty(object, 'length', { 'value': 'x' }); @@ -2547,7 +2554,7 @@ _.forEach(['max', 'min'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` should iterate an object', function() { + test('`_.' + methodName + '` should iterate an object', 1, function() { var actual = func({ 'a': 1, 'b': 2, 'c': 3 }); equal(actual, methodName == 'max' ? 3 : 1); }); @@ -2560,7 +2567,7 @@ _.forEach(['max', 'min'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` should iterate a string', function() { + test('`_.' + methodName + '` should iterate a string', 2, function() { _.forEach(['abc', Object('abc')], function(value) { var actual = func(value); equal(actual, methodName == 'max' ? 'c' : 'a'); @@ -2573,7 +2580,7 @@ QUnit.module('lodash.max and lodash.min chaining'); _.forEach(['max', 'min'], function(methodName) { - test('`_.' + methodName + '` should resolve the correct value when provided an array containing only one value', function() { + test('`_.' + methodName + '` should resolve the correct value when provided an array containing only one value', 1, function() { var actual = _([40])[methodName]().value(); strictEqual(actual, 40); }); @@ -2584,7 +2591,7 @@ QUnit.module('lodash.memoize'); (function() { - test('should expose a `cache` object on the `memoized` function', function() { + test('should expose a `cache` object on the `memoized` function', 2, function() { var memoized = _.memoize(_.identity, _.identity); memoized('x'); @@ -2602,7 +2609,7 @@ (function() { var args = arguments; - test('should merge `source` into the destination object', function() { + test('should merge `source` into the destination object', 1, function() { var names = { 'stooges': [ { 'name': 'moe' }, @@ -2634,7 +2641,7 @@ deepEqual(_.merge(names, ages, heights), expected); }); - test('should merge sources containing circular references', function() { + test('should merge sources containing circular references', 1, function() { var object = { 'foo': { 'a': 1 }, 'bar': { 'a': 2 } @@ -2652,7 +2659,7 @@ ok(actual.bar.b === actual.foo.b && actual.foo.b.foo.c === actual.foo.b.foo.c.foo.b.foo.c); }); - test('should not treat `arguments` objects as plain objects', function() { + test('should not treat `arguments` objects as plain objects', 1, function() { var object = { 'args': args }; @@ -2665,34 +2672,34 @@ equal(_.isArguments(actual.args), false); }); - test('should work with four arguments', function() { + test('should work with four arguments', 1, function() { var expected = { 'a': 4 }; deepEqual(_.merge({ 'a': 1 }, { 'a': 2 }, { 'a': 3 }, expected), expected); }); - test('should assign `null` values', function() { + test('should assign `null` values', 1, function() { var actual = _.merge({ 'a': 1 }, { 'a': null }); strictEqual(actual.a, null); }); - test('should not assign `undefined` values', function() { + test('should not assign `undefined` values', 1, function() { var actual = _.merge({ 'a': 1 }, { 'a': undefined }); strictEqual(actual.a, 1); }); - test('should handle merging if `callback` returns `undefined`', function() { + test('should handle merging if `callback` returns `undefined`', 1, function() { var actual = _.merge({ 'a': { 'b': [1, 1] } }, { 'a': { 'b': [0] } }, function() {}); deepEqual(actual, { 'a': { 'b': [0, 1] } }); }); - test('should defer to `callback` when it returns a value other than `undefined`', function() { + test('should defer to `callback` when it returns a value other than `undefined`', 1, function() { var actual = _.merge({ 'a': { 'b': [0, 1] } }, { 'a': { 'b': [2] } }, function(a, b) { return _.isArray(a) ? a.concat(b) : undefined; }); deepEqual(actual, { 'a': { 'b': [0, 1, 2] } }); }); - test('should pass the correct values to `callback`', function() { + test('should pass the correct values to `callback`', 1, function() { var argsList = [], array = [1, 2], object = { 'b': 2 }; @@ -2710,13 +2717,13 @@ QUnit.module('lodash.mixin'); (function() { - test('should accept an `object` argument', function() { + test('should accept an `object` argument', 1, function() { var lodash = {}; _.mixin(lodash, { 'a': function(a) { return a[0]; } }); strictEqual(lodash.a(['a']), 'a'); }); - test('should accept a function `object` argument', function() { + test('should accept a function `object` argument', 1, function() { function lodash(value) { if (!(this instanceof lodash)) { return new lodash(value); @@ -2740,34 +2747,34 @@ object = { 'a': 1, 'b': 2 }, expected = { 'b': 2 }; - test('should accept individual property names', function() { + test('should accept individual property names', 1, function() { deepEqual(_.omit(object, 'a'), expected); }); - test('should accept an array of property names', function() { + test('should accept an array of property names', 1, function() { deepEqual(_.omit(object, ['a', 'c']), expected); }); - test('should accept mixes of individual and arrays of property names', function() { + test('should accept mixes of individual and arrays of property names', 1, function() { deepEqual(_.omit(object, ['a'], 'c'), expected); }); - test('should iterate over inherited properties', function() { + test('should iterate over inherited properties', 1, function() { function Foo() {} Foo.prototype = object; deepEqual(_.omit(new Foo, 'a'), expected); }); - test('should work with `arguments` objects as secondary arguments', function() { + test('should work with `arguments` objects as secondary arguments', 1, function() { deepEqual(_.omit(object, args), expected); }); - test('should work with an array `object` argument', function() { + test('should work with an array `object` argument', 1, function() { deepEqual(_.omit([1, 2, 3], '0', '2'), { '1': 2 }); }); - test('should work with a `callback` argument', function() { + test('should work with a `callback` argument', 1, function() { var actual = _.omit(object, function(num) { return num === 1; }); @@ -2775,7 +2782,7 @@ deepEqual(actual, expected); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args, lastKey = _.keys(object).pop(); @@ -2790,7 +2797,7 @@ deepEqual(args, expected); }); - test('should correct set the `this` binding', function() { + test('should correct set the `this` binding', 1, function() { var actual = _.omit(object, function(num) { return num === this.a; }, { 'a': 1 }); @@ -2804,7 +2811,7 @@ QUnit.module('lodash.once'); (function() { - test('should ignore recursive calls', function() { + test('should ignore recursive calls', 1, function() { var count = 0; var func = _.once(function() { @@ -2816,7 +2823,7 @@ strictEqual(count, 1); }); - test('should not throw more than once', function() { + test('should not throw more than once', 2, function() { var pass = true; var func = _.once(function() { @@ -2839,19 +2846,19 @@ QUnit.module('lodash.parseInt'); (function() { - test('should parse strings with leading whitespace and zeros with a `radix` of 10 by default (test in Chrome, Firefox, and Opera)', function() { + test('should parse strings with leading whitespace and zeros with a `radix` of 10 by default (test in Chrome, Firefox, and Opera)', 2, function() { var whitespace = ' \x09\x0B\x0C\xA0\ufeff\x0A\x0D\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'; equal(_.parseInt('08'), 8); equal(_.parseInt(whitespace + '08'), 8); }); - test('should use a radix of `10`, for non-hexadecimals, if `radix` is `undefined` or `0`', function() { + test('should use a radix of `10`, for non-hexadecimals, if `radix` is `undefined` or `0`', 3, function() { equal(_.parseInt('10', 0), 10); equal(_.parseInt('10'), 10); equal(_.parseInt('10', undefined), 10); }); - test('should use a radix of `16`, for hexadecimals, if `radix` is `undefined` or `0`', function() { + test('should use a radix of `16`, for hexadecimals, if `radix` is `undefined` or `0`', 3, function() { equal(_.parseInt('0x20', 0), 32); equal(_.parseInt('0x20'), 32); equal(_.parseInt('0x20', undefined), 32); @@ -2865,14 +2872,14 @@ _.forEach(['partial', 'partialRight'], function(methodName) { var func = _[methodName]; - test('`_.' + methodName + '` partially applies an argument, without additional arguments', function() { + test('`_.' + methodName + '` partially applies an argument, without additional arguments', 1, function() { var arg = 'a', fn = function(x) { return x; }; equal(func(fn, arg)(), arg); }); - test('`_.' + methodName + '` partially applies an argument, with additional arguments', function() { + test('`_.' + methodName + '` partially applies an argument, with additional arguments', 1, function() { var arg1 = 'a', arg2 = 'b', expected = [arg1, arg2], @@ -2884,19 +2891,19 @@ deepEqual(func(fn, arg1)(arg2), expected); }); - test('`_.' + methodName + '` works without partially applying arguments, without additional arguments', function() { + test('`_.' + methodName + '` works without partially applying arguments, without additional arguments', 1, function() { var fn = function() { return arguments.length; }; strictEqual(func(fn)(), 0); }); - test('`_.' + methodName + '` works without partially applying arguments, with additional arguments', function() { + test('`_.' + methodName + '` works without partially applying arguments, with additional arguments', 1, function() { var arg = 'a', fn = function(x) { return x; }; equal(func(fn)(arg), arg); }); - test('`_.' + methodName + '` should not alter the `this` binding', function() { + test('`_.' + methodName + '` should not alter the `this` binding', 3, function() { var object = { 'a': 1 }, fn = function() { return this.a; }; @@ -2913,7 +2920,7 @@ QUnit.module('lodash.partialRight'); (function() { - test('should work as a deep `_.defaults`', function() { + test('should work as a deep `_.defaults`', 1, function() { var object = { 'a': { 'b': 1 } }, source = { 'a': { 'b': 2, 'c': 3 } }, expected = { 'a': { 'b': 1, 'c': 3 } }; @@ -2928,7 +2935,7 @@ QUnit.module('methods using `createBound`'); (function() { - test('combinations of partial functions should work', function() { + test('combinations of partial functions should work', 1, function() { function func() { return slice.call(arguments); } @@ -2939,7 +2946,7 @@ deepEqual(c(2), [1, 2, 3]); }); - test('combinations of bound and partial functions should work', function() { + test('combinations of bound and partial functions should work', 3, function() { function func() { var result = [this.x]; push.apply(result, arguments); @@ -2967,7 +2974,7 @@ deepEqual(c(3), expected); }); - test('recursively bound functions should work', function() { + test('recursively bound functions should work', 1, function() { function func() { return this.x; } @@ -2988,22 +2995,22 @@ object = { 'a': 1, 'b': 2 }, expected = { 'b': 2 }; - test('should iterate over inherited properties', function() { + test('should iterate over inherited properties', 1, function() { function Foo() {} Foo.prototype = object; deepEqual(_.pick(new Foo, 'b'), expected); }); - test('should work with `arguments` objects as secondary arguments', function() { + test('should work with `arguments` objects as secondary arguments', 1, function() { deepEqual(_.pick(object, args), expected); }); - test('should work with an array `object` argument', function() { + test('should work with an array `object` argument', 1, function() { deepEqual(_.pick([1, 2, 3], '1'), { '1': 2 }); }); - test('should work with a `callback` argument', function() { + test('should work with a `callback` argument', 1, function() { var actual = _.pick(object, function(num) { return num === 2; }); @@ -3011,7 +3018,7 @@ deepEqual(actual, expected); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args, lastKey = _.keys(object).pop(); @@ -3026,7 +3033,7 @@ deepEqual(args, expected); }); - test('should correct set the `this` binding', function() { + test('should correct set the `this` binding', 1, function() { var actual = _.pick(object, function(num) { return num === this.b; }, { 'b': 2 }); @@ -3040,7 +3047,7 @@ QUnit.module('lodash.pluck'); (function() { - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var object = { 'a': [1], 'b': [1, 2], 'c': [1, 2, 3] }; deepEqual(_.pluck(object, 'length'), [1, 2, 3]); }); @@ -3051,7 +3058,7 @@ QUnit.module('lodash.pull'); (function() { - test('should modify and return the array', function() { + test('should modify and return the array', 2, function() { var array = [1, 2, 3], actual = _.pull(array, 1, 3); @@ -3059,7 +3066,7 @@ ok(actual === array); }); - test('should preserve holes in arrays', function() { + test('should preserve holes in arrays', 2, function() { var array = [1, 2, 3, 4]; delete array[1]; delete array[3]; @@ -3069,7 +3076,7 @@ equal(2 in array, false); }); - test('should treat holes as `undefined`', function() { + test('should treat holes as `undefined`', 1, function() { var array = [1, 2, 3]; delete array[1]; @@ -3083,12 +3090,12 @@ QUnit.module('lodash.random'); (function() { - test('should return `0` or `1` when arguments are not provided', function() { + test('should return `0` or `1` when arguments are not provided', 1, function() { var actual = _.random(); ok(actual === 0 || actual === 1); }); - test('supports not passing a `max` argument', function() { + test('supports not passing a `max` argument', 1, function() { var actual = _.random(5), limit = 60, start = new Date; @@ -3099,7 +3106,7 @@ notEqual(actual, 5); }); - test('supports large integer values', function() { + test('supports large integer values', 2, function() { var array = Array(1000), min = Math.pow(2, 31), max = Math.pow(2, 62); @@ -3113,11 +3120,11 @@ }), true); }); - test('should coerce arguments to numbers', function() { + test('should coerce arguments to numbers', 1, function() { strictEqual(_.random('1', '1'), 1); }); - test('should support floats', function() { + test('should support floats', 2, function() { var min = 1.5, max = 1.6, actual = _.random(min, max); @@ -3126,7 +3133,7 @@ ok(actual >= min && actual <= max); }); - test('supports passing a `floating` argument', function() { + test('supports passing a `floating` argument', 3, function() { var actual = _.random(true); ok(actual % 1 && actual >= 0 && actual <= 1); @@ -3145,7 +3152,7 @@ (function() { var func = _.range; - test('should treat falsey `start` arguments as `0`', function() { + test('should treat falsey `start` arguments as `0`', 13, function() { _.forEach(falsey, function(value, index) { if (index) { deepEqual(_.range(value), []); @@ -3156,12 +3163,12 @@ }); }); - test('should coerce arguments to numbers', function() { + test('should coerce arguments to numbers', 1, function() { var actual = [func('0',1), func('1'), func(0, 1, '1')]; deepEqual(actual, [[0], [0], [0]]); }); - test('should support a `step` of `0`', function() { + test('should support a `step` of `0`', 1, function() { deepEqual(_.range(1, 4, 0), [1, 1, 1]); }); }()); @@ -3171,7 +3178,7 @@ QUnit.module('lodash.reduce'); (function() { - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args, array = [1, 2, 3]; @@ -3187,7 +3194,7 @@ 'object': Object('abc') }, function(collection, key) { - test('should work with a string ' + key + ' for `collection` (test in IE < 9)', function() { + test('should work with a string ' + key + ' for `collection` (test in IE < 9)', 2, function() { var args; var actual = _.reduce(collection, function(accumulator, value) { @@ -3206,7 +3213,7 @@ QUnit.module('lodash.reduceRight'); (function() { - test('should pass the correct `callback` arguments when iterating an array', function() { + test('should pass the correct `callback` arguments when iterating an array', 1, function() { var args, array = [1, 2, 3]; @@ -3217,7 +3224,7 @@ deepEqual(args, [3, 2, 1, array]); }); - test('should pass the correct `callback` arguments when iterating an object', function() { + test('should pass the correct `callback` arguments when iterating an object', 1, function() { var args, object = { 'a': 1, 'b': 2 }, lastKey = _.keys(object).pop(); @@ -3238,7 +3245,7 @@ 'object': Object('abc') }, function(collection, key) { - test('should work with a string ' + key + ' for `collection` (test in IE < 9)', function() { + test('should work with a string ' + key + ' for `collection` (test in IE < 9)', 2, function() { var args; var actual = _.reduceRight(collection, function(accumulator, value) { @@ -3257,7 +3264,7 @@ QUnit.module('lodash.remove'); (function() { - test('should modify the array and return removed elements', function() { + test('should modify the array and return removed elements', 2, function() { var array = [1, 2, 3]; var actual = _.remove(array, function(num) { @@ -3268,7 +3275,7 @@ deepEqual(actual, [1, 2]); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args, array = [1, 2, 3]; @@ -3279,7 +3286,7 @@ deepEqual(args, [1, 0, array]); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var array = [1, 2, 3]; var actual = _.remove(array, function(num, index) { @@ -3289,7 +3296,7 @@ deepEqual(actual, [1, 2]); }); - test('should preserve holes in arrays', function() { + test('should preserve holes in arrays', 2, function() { var array = [1, 2, 3, 4]; delete array[1]; delete array[3]; @@ -3299,7 +3306,7 @@ equal(2 in array, false); }); - test('should treat holes as `undefined`', function() { + test('should treat holes as `undefined`', 1, function() { var array = [1, 2, 3]; delete array[1]; @@ -3313,7 +3320,7 @@ QUnit.module('lodash.result'); (function() { - test('should return `undefined` when provided a falsey `object` argument', function() { + test('should return `undefined` when provided a falsey `object` argument', 1, function() { strictEqual(_.result(), undefined); }); }()); @@ -3331,7 +3338,7 @@ { 'a': 0, 'b': 0 } ]; - test('should accept a falsey `array` argument', function() { + test('should accept a falsey `array` argument', 7, function() { _.forEach(falsey, function(index, value) { try { var actual = index ? _.rest(value) : _.rest(); @@ -3340,38 +3347,38 @@ }) }); - test('should exclude the first element', function() { + test('should exclude the first element', 1, function() { deepEqual(_.rest(array), [2, 3]); }); - test('should exclude the first two elements', function() { + test('should exclude the first two elements', 1, function() { deepEqual(_.rest(array, 2), [3]); }); - test('should return all elements when `n` < `1`', function() { + test('should return all elements when `n` < `1`', 3, function() { _.each([0, -1, -2], function(n) { deepEqual(_.rest(array, n), [1, 2, 3]); }); }); - test('should return an empty array when `n` >= `array.length`', function() { + test('should return an empty array when `n` >= `array.length`', 2, function() { _.each([3, 4], function(n) { deepEqual(_.rest(array, n), []); }); }); - test('should return an empty when querying empty arrays', function() { + test('should return an empty when querying empty arrays', 1, function() { deepEqual(_.rest([]), []); }); - test('should work when used as `callback` for `_.map`', function() { + test('should work when used as `callback` for `_.map`', 1, function() { var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], actual = _.map(array, _.rest); deepEqual(actual, [[2, 3], [5, 6], [8, 9]]); }); - test('should work with a `callback`', function() { + test('should work with a `callback`', 1, function() { var actual = _.rest(array, function(num) { return num < 3; }); @@ -3379,7 +3386,7 @@ deepEqual(actual, [3]); }); - test('should pass the correct `callback` arguments', function() { + test('should pass the correct `callback` arguments', 1, function() { var args; _.rest(array, function() { @@ -3389,7 +3396,7 @@ deepEqual(args, [1, 0, array]); }); - test('supports the `thisArg` argument', function() { + test('supports the `thisArg` argument', 1, function() { var actual = _.rest(array, function(num, index) { return this[index] < 3; }, array); @@ -3397,11 +3404,11 @@ deepEqual(actual, [3]); }); - test('should work with an object for `callback`', function() { + test('should work with an object for `callback`', 1, function() { deepEqual(_.rest(objects, { 'b': 2 }), objects.slice(-2)); }); - test('should work with a string for `callback`', function() { + test('should work with a string for `callback`', 1, function() { deepEqual(_.rest(objects, 'b'), objects.slice(-1)); }); }()); @@ -3411,7 +3418,7 @@ QUnit.module('lodash.runInContext'); (function() { - test('should not require a fully populated `context` object', function() { + test('should not require a fully populated `context` object', 1, function() { if (!isModularize) { var lodash = _.runInContext({ 'setTimeout': function(callback) { @@ -3422,7 +3429,8 @@ var pass = false; lodash.delay(function() { pass = true; }, 32); ok(pass); - } else { + } + else { skipTest(); } }); @@ -3435,33 +3443,33 @@ (function() { var array = [1, 2, 3]; - test('should return a random element', function() { + test('should return a random element', 1, function() { var actual = _.sample(array); ok(_.contains(array, actual)); }); - test('should return two random elements', function() { + test('should return two random elements', 1, function() { var actual = _.sample(array, 2); ok(actual[0] !== actual[1] && _.contains(array, actual[0]) && _.contains(array, actual[1])); }); - test('should return an empty array when `n` < `1`', function() { + test('should return an empty array when `n` < `1`', 3, function() { _.each([0, -1, -2], function(n) { deepEqual(_.sample(array, n), []); }); }); - test('should return all elements when `n` >= `array.length`', function() { + test('should return all elements when `n` >= `array.length`', 2, function() { _.each([3, 4], function(n) { deepEqual(_.sample(array, n).sort(), array.slice()); }); }); - test('should return `undefined` when sampling an empty array', function() { + test('should return `undefined` when sampling an empty array', 1, function() { strictEqual(_.sample([]), undefined); }); - test('should sample an object', function() { + test('should sample an object', 2, function() { var object = { 'a': 1, 'b': 2, 'c': 3 }, actual = _.sample(object); @@ -3471,7 +3479,7 @@ ok(actual[0] !== actual[1] && _.contains(array, actual[0]) && _.contains(array, actual[1])); }); - test('should work when used as `callback` for `_.map`', function() { + test('should work when used as `callback` for `_.map`', 1, function() { var a = [1, 2, 3], b = [4, 5, 6], c = [7, 8, 9], @@ -3480,12 +3488,12 @@ ok(_.contains(a, actual[0]) && _.contains(b, actual[1]) && _.contains(c, actual[2])); }); - test('should chain when passing `n`', function() { + test('should chain when passing `n`', 1, function() { var actual = _(array).sample(2); ok(actual instanceof _); }); - test('should not chain when arguments are not provided', function() { + test('should not chain when arguments are not provided', 1, function() { var actual = _(array).sample(); ok(_.contains(array, actual)); }); @@ -3495,7 +3503,7 @@ 'object': Object('abc') }, function(collection, key) { - test('should work with a string ' + key + ' for `collection`', function() { + test('should work with a string ' + key + ' for `collection`', 2, function() { var actual = _.sample(collection); ok(_.contains(collection, actual)); @@ -3510,7 +3518,7 @@ QUnit.module('lodash.shuffle'); (function() { - test('should shuffle an object', function() { + test('should shuffle an object', 1, function() { var actual = _.shuffle({ 'a': 1, 'b': 2, 'c': 3 }); deepEqual(actual.sort(), [1, 2, 3]); }); @@ -3520,7 +3528,7 @@ 'object': Object('abc') }, function(collection, key) { - test('should work with a string ' + key + ' for `collection`', function() { + test('should work with a string ' + key + ' for `collection`', 1, function() { var actual = _.shuffle(collection); deepEqual(actual.sort(), ['a','b', 'c']); }); @@ -3534,7 +3542,7 @@ (function() { var args = arguments; - test('should accept a falsey `object` argument', function() { + test('should accept a falsey `object` argument', 7, function() { _.forEach(falsey, function(index, value) { try { var actual = index ? _.size(value) : _.size(); @@ -3543,14 +3551,14 @@ }) }); - test('should work with jQuery/MooTools DOM query collections', function() { + test('should work with jQuery/MooTools DOM query collections', 1, function() { function Foo(elements) { push.apply(this, elements); } Foo.prototype = { 'length': 0, 'splice': Array.prototype.splice }; equal(_.size(new Foo([1, 2, 3])), 3); }); - test('should work with `arguments` objects (test in IE < 9)', function() { + test('should work with `arguments` objects (test in IE < 9)', 1, function() { if (!isPhantomPage) { equal(_.size(args), 3); } else { @@ -3558,7 +3566,7 @@ } }); - test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { + test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', 1, function() { equal(_.size(shadowedObject), 7); }); @@ -3567,7 +3575,7 @@ 'object': Object('abc') }, function(collection, key) { - test('should work with a string ' + key + ' for `collection`', function() { + test('should work with a string ' + key + ' for `collection`', 1, function() { deepEqual(_.size(collection), 3); }); }); @@ -3578,7 +3586,7 @@ QUnit.module('lodash.some'); (function() { - test('should return `true` as soon as the `callback` result is truey', function() { + test('should return `true` as soon as the `callback` result is truey', 1, function() { strictEqual(_.some([null, true, null], _.identity), true); }); }()); @@ -3588,7 +3596,7 @@ QUnit.module('lodash.sortBy'); (function() { - test('should sort in ascending order', function() { + test('should sort in ascending order', 1, function() { var actual = _.pluck(_.sortBy([ { 'num': 991 }, { 'num': 212 }, @@ -3602,7 +3610,7 @@ deepEqual(actual, [0, 11, 16, 74, 212, 991, 1515]); }); - test('should perform a stable sort (test in IE > 8, Opera, and V8)', function() { + test('should perform a stable sort (test in IE > 8, Opera, and V8)', 1, function() { function Pair(x, y) { this.x = x; this.y = y; @@ -3627,12 +3635,12 @@ deepEqual(actual, collection); }); - test('should use `_.identity` when no `callback` is provided', function() { + test('should use `_.identity` when no `callback` is provided', 1, function() { var actual = _.sortBy([3, 2, 1]); deepEqual(actual, [1, 2, 3]); }); - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); @@ -3640,7 +3648,7 @@ deepEqual(actual, [3, 1, 2]); }); - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var actual = _.sortBy({ 'a': 1, 'b': 2, 'c': 3 }, function(num) { return Math.sin(num); }); @@ -3654,7 +3662,7 @@ QUnit.module('lodash.sortedIndex'); (function() { - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.sortedIndex([1, 2, 3], 4, function(num) { return this.sin(num); }, Math); @@ -3662,7 +3670,7 @@ strictEqual(actual, 0); }); - test('supports arrays with lengths larger than `Math.pow(2, 31) - 1`', function() { + test('supports arrays with lengths larger than `Math.pow(2, 31) - 1`', 1, function() { var length = Math.pow(2, 32) - 1, index = length - 1, array = Array(length), @@ -3679,11 +3687,11 @@ QUnit.module('lodash.support'); (function() { - test('should contain properties with boolean values', function() { + test('should contain properties with boolean values', 1, function() { ok(_.every(_.values(_.support), _.isBoolean)); }); - test('should not contain minified properties (test production builds)', function() { + test('should not contain minified properties (test production builds)', 1, function() { var props = [ 'argsClass', 'argsObject', @@ -3709,20 +3717,20 @@ QUnit.module('lodash.template'); (function() { - test('supports recursive calls', function() { + test('supports recursive calls', 1, function() { var compiled = _.template('<%= a %><% a = _.template(c, obj) %><%= a %>'), data = { 'a': 'A', 'b': 'B', 'c': '<%= b %>' }; equal(compiled(data), 'AB'); }); - test('should not augment the `options` object', function() { + test('should not augment the `options` object', 1, function() { var options = {}; _.template('', null, options); deepEqual(options, {}); }); - test('should provide the template source when a SyntaxError occurs', function() { + test('should provide the template source when a SyntaxError occurs', 1, function() { try { _.template('<% if x %>'); } catch(e) { @@ -3731,7 +3739,7 @@ ok(/__p/.test(source)); }); - test('should work with complex "interpolate" delimiters', function() { + test('should work with complex "interpolate" delimiters', 22, function() { _.forEach({ '<%= a + b %>': '3', '<%= b - a %>': '1', @@ -3764,14 +3772,14 @@ }); }); - test('should allow referencing variables declared in "evaluate" delimiters from other delimiters', function() { + test('should allow referencing variables declared in "evaluate" delimiters from other delimiters', 1, function() { var compiled = _.template('<% var b = a; %><%= b.value %>'), data = { 'a': { 'value': 1 } }; equal(compiled(data), '1'); }); - test('should work when passing `options.variable`', function() { + test('should work when passing `options.variable`', 1, function() { var compiled = _.template( '<% _.forEach( data.a, function( value ) { %>' + '<%= value.valueOf() %>' + @@ -3787,7 +3795,7 @@ } }); - test('should not error with IE conditional comments enabled (test with development build)', function() { + test('should not error with IE conditional comments enabled (test with development build)', 1, function() { var compiled = _.template(''), pass = true; @@ -3800,21 +3808,21 @@ ok(pass); }); - test('should tokenize delimiters', function() { + test('should tokenize delimiters', 1, function() { var compiled = _.template(''), data = { 'type': 1 }; equal(compiled(data), ''); }); - test('should work with "interpolate" delimiters containing ternary operators', function() { + test('should work with "interpolate" delimiters containing ternary operators', 1, function() { var compiled = _.template('<%= value ? value : "b" %>'), data = { 'value': 'a' }; equal(compiled(data), 'a'); }); - test('should work with "interpolate" delimiters containing global values', function() { + test('should work with "interpolate" delimiters containing global values', 1, function() { var compiled = _.template('<%= typeof Math.abs %>'); try { @@ -3824,7 +3832,7 @@ equal(actual, 'function'); }); - test('should parse delimiters with newlines', function() { + test('should parse delimiters with newlines', 1, function() { var expected = '<<\nprint("

" + (value ? "yes" : "no") + "

")\n>>', compiled = _.template(expected, null, { 'evaluate': /<<(.+?)>>/g }), data = { 'value': true }; @@ -3832,13 +3840,13 @@ equal(compiled(data), expected); }); - test('should parse ES6 template delimiters', function() { + test('should parse ES6 template delimiters', 2, function() { var data = { 'value': 2 }; equal(_.template('1${value}3', data), '123'); equal(_.template('${"{" + value + "\\}"}', data), '{2}'); }); - test('supports the "imports" option', function() { + test('supports the "imports" option', 1, function() { var options = { 'imports': { 'a': 1 } }, compiled = _.template('<%= a %>', null, options); @@ -3851,7 +3859,7 @@ QUnit.module('lodash.throttle'); (function() { - test('subsequent calls should return the result of the first call', function() { + test('subsequent calls should return the result of the first call', 1, function() { if (!(isRhino && isModularize)) { var throttled = _.throttle(function(value) { return value; }, 32), result = [throttled('x'), throttled('y')]; @@ -3863,7 +3871,7 @@ } }); - test('should clear timeout when `func` is called', function() { + test('should clear timeout when `func` is called', 1, function() { if (!isModularize) { var callCount = 0, dateCount = 0; @@ -3889,7 +3897,7 @@ } }); - asyncTest('supports recursive calls', function() { + asyncTest('supports recursive calls', 2, function() { if (!(isRhino && isModularize)) { var count = 0; var throttled = _.throttle(function() { @@ -3913,7 +3921,7 @@ } }); - asyncTest('should not trigger a trailing call when invoked once', function() { + asyncTest('should not trigger a trailing call when invoked once', 2, function() { if (!(isRhino && isModularize)) { var count = 0, throttled = _.throttle(function() { count++; }, 32); @@ -3933,7 +3941,7 @@ }); _.times(2, function(index) { - asyncTest('should trigger trailing call when invoked repeatedly' + (index ? ' and `leading` is `false`' : '') , function() { + asyncTest('should trigger trailing call when invoked repeatedly' + (index ? ' and `leading` is `false`' : ''), 2, function() { if (!(isRhino && isModularize)) { var count = 0, limit = 160, @@ -3959,7 +3967,7 @@ }); }); - asyncTest('should apply default options correctly', function() { + asyncTest('should apply default options correctly', 3, function() { if (!(isRhino && isModularize)) { var count = 0; @@ -3983,7 +3991,7 @@ } }); - test('should work with `leading` option', function() { + test('should work with `leading` option', 4, function() { if (!(isRhino && isModularize)) { _.forEach([true, { 'leading': true }], function(options) { var withLeading = _.throttle(_.identity, 32, options); @@ -4000,7 +4008,7 @@ } }); - asyncTest('should work with `trailing` option', function() { + asyncTest('should work with `trailing` option', 6, function() { if (!(isRhino && isModularize)) { var withCount = 0, withoutCount = 0; @@ -4032,7 +4040,7 @@ } }); - asyncTest('should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`', function() { + asyncTest('should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`', 1, function() { if (!(isRhino && isModularize)) { var count = 0; @@ -4062,7 +4070,7 @@ (function() { var args = arguments; - test('should return a dense array', function() { + test('should return a dense array', 3, function() { var array = Array(3); array[1] = 2; @@ -4073,18 +4081,18 @@ deepEqual(actual, array); }); - test('should treat array-like objects like arrays', function() { + test('should treat array-like objects like arrays', 2, function() { var object = { '0': 'a', '1': 'b', '2': 'c', 'length': 3 }; deepEqual(_.toArray(object), ['a', 'b', 'c']); deepEqual(_.toArray(args), [1, 2, 3]); }); - test('should work with a string for `collection` (test in Opera < 10.52)', function() { + test('should work with a string for `collection` (test in Opera < 10.52)', 2, function() { deepEqual(_.toArray('abc'), ['a', 'b', 'c']); deepEqual(_.toArray(Object('abc')), ['a', 'b', 'c']); }); - test('should work with a node list for `collection` (test in IE < 9)', function() { + test('should work with a node list for `collection` (test in IE < 9)', 1, function() { if (document) { try { var nodeList = document.getElementsByTagName('body'), @@ -4102,15 +4110,15 @@ QUnit.module('lodash.times'); (function() { - test('should return an array of the results of each `callback` execution', function() { + test('should return an array of the results of each `callback` execution', 1, function() { deepEqual(_.times(3, function(n) { return n * 2; }), [0, 2, 4]); }); - test('should coerce `n` to a number', function() { + test('should coerce `n` to a number', 1, function() { deepEqual(_.times(null), []); }); - test('should not error on negative `n` values', function() { + test('should not error on negative `n` values', 1, function() { var pass = true; try { _.times(-1); @@ -4126,7 +4134,7 @@ QUnit.module('lodash.transform'); (function() { - test('should produce an that is an instance of the given object\'s constructor', function() { + test('should produce an that is an instance of the given object\'s constructor', 2, function() { function Foo() { this.a = 1; this.b = 2; @@ -4141,7 +4149,7 @@ deepEqual(_.clone(actual), { 'a': 1, 'b': 4, 'c': 9 }); }); - test('should treat sparse arrays as dense', function() { + test('should treat sparse arrays as dense', 1, function() { var actual = _.transform(Array(1), function(result, value, index) { result[index] = String(value); }); @@ -4154,7 +4162,7 @@ 'object': { 'a': 1, 'b': 2, 'c': 3 } }, function(object, key) { - test('should pass the correct `callback` arguments when transforming an ' + key, function() { + test('should pass the correct `callback` arguments when transforming an ' + key, 2, function() { var args; _.transform(object, function() { @@ -4171,7 +4179,7 @@ } }); - test('should support the `thisArg` argument when transforming an ' + key, function() { + test('should support the `thisArg` argument when transforming an ' + key, 2, function() { var actual = _.transform(object, function(result, value, key) { result[key] = this[key]; }, null, object); @@ -4190,19 +4198,19 @@ var escaped = '&<>"'\/', unescaped = '&<>"\'\/'; - test('should unescape entities in the correct order', function() { + test('should unescape entities in the correct order', 1, function() { equal(_.unescape('&lt;'), '<'); }); - test('should unescape the proper entities', function() { + test('should unescape the proper entities', 1, function() { equal(_.unescape(escaped), unescaped); }); - test('should unescape the same characters escaped by `_.escape`', function() { + test('should unescape the same characters escaped by `_.escape`', 1, function() { equal(_.unescape(_.escape(unescaped)), unescaped); }); - test('should return an empty string when provided `null` or `undefined`', function() { + test('should return an empty string when provided `null` or `undefined`', 2, function() { equal(_.unescape(null), ''); equal(_.unescape(undefined), ''); }); @@ -4213,14 +4221,14 @@ QUnit.module('lodash.union'); (function() { - test('should produce correct results when provided a falsey `array` argument', function() { + test('should produce correct results when provided a falsey `array` argument', 1, function() { var expected = [1, 2, 3], actual = _.union(null, expected); deepEqual(actual, expected); }); - test('should not accept individual secondary values', function() { + test('should not accept individual secondary values', 1, function() { deepEqual(_.union([1], 1, 2, 3), [1]); }); }()); @@ -4230,7 +4238,7 @@ QUnit.module('lodash.uniq'); (function() { - test('should support the `thisArg` argument', function() { + test('should support the `thisArg` argument', 1, function() { var actual = _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); @@ -4238,14 +4246,14 @@ deepEqual(actual, [1, 2, 3]); }); - test('should perform an unsorted uniq operation when used as `callback` for `_.map`', function() { + test('should perform an unsorted uniq operation when used as `callback` for `_.map`', 1, function() { var array = [[2, 1, 2], [1, 2, 1]], actual = _.map(array, _.uniq); deepEqual(actual, [[2, 1], [1, 2]]); }); - test('should work with large arrays of boolean, `null`, and `undefined` values', function() { + test('should work with large arrays of boolean, `null`, and `undefined` values', 1, function() { var array = [], expected = [true, false, null, undefined], count = Math.ceil(largeArraySize / expected.length); @@ -4256,7 +4264,7 @@ deepEqual(_.uniq(array), expected); }); - test('should distinguish between numbers and numeric strings', function() { + test('should distinguish between numbers and numeric strings', 1, function() { var array = [], expected = ['2', 2, Object('2'), Object(2)], count = Math.ceil(largeArraySize / expected.length); @@ -4274,7 +4282,7 @@ 'a string': '0' }, function(callback, key) { - test('should work with ' + key + ' for `callback`', function() { + test('should work with ' + key + ' for `callback`', 1, function() { var actual = _.uniq([['a'], ['b'], ['a']], callback); deepEqual(actual, [['a'], ['b']]); }); @@ -4286,11 +4294,11 @@ QUnit.module('lodash.uniqueId'); (function() { - test('should return a string value when not passing a prefix argument', function() { + test('should return a string value when not passing a prefix argument', 1, function() { equal(typeof _.uniqueId(), 'string'); }); - test('should coerce the prefix argument to a string', function() { + test('should coerce the prefix argument to a string', 1, function() { var actual = [_.uniqueId(3), _.uniqueId(2), _.uniqueId(1)]; ok(/3\d+,2\d+,1\d+/.test(actual)); }); @@ -4309,7 +4317,7 @@ { 'a': 3 } ]; - test('should filter by properties', function() { + test('should filter by properties', 6, function() { deepEqual(_.where(array, { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }]); deepEqual(_.where(array, { 'a': 2 }), [{ 'a': 2, 'b': 2 }]); deepEqual(_.where(array, { 'a': 3 }), [{ 'a': 3 }]); @@ -4318,7 +4326,7 @@ deepEqual(_.where(array, { 'a': 1, 'b': 2 }), [{ 'a': 1, 'b': 2 }]); }); - test('should not filter by inherited properties', function() { + test('should not filter by inherited properties', 1, function() { function Foo() {} Foo.prototype = { 'a': 2 }; @@ -4327,12 +4335,12 @@ deepEqual(_.where(array, properties), [{ 'a': 1, 'b': 2 }, { 'a': 2, 'b': 2 }]); }); - test('should filter by problem JScript properties (test in IE < 9)', function() { + test('should filter by problem JScript properties (test in IE < 9)', 1, function() { var collection = [shadowedObject]; deepEqual(_.where(collection, shadowedObject), [shadowedObject]); }); - test('should work with an object for `collection`', function() { + test('should work with an object for `collection`', 1, function() { var collection = { 'x': { 'a': 1 }, 'y': { 'a': 3 }, @@ -4342,18 +4350,18 @@ deepEqual(_.where(collection, { 'a': 1 }), [{ 'a': 1 }, { 'a': 1, 'b': 2 }]); }); - test('should return an empty array when provided an empty `properties` object', function() { + test('should return an empty array when provided an empty `properties` object', 1, function() { deepEqual(_.where(array, {}), []); }); - test('should deep compare `properties` values', function() { + test('should deep compare `properties` values', 1, function() { var collection = [{ 'a': { 'b': { 'c': 1, 'd': 2 }, 'e': 3 }, 'f': 4 }], expected = _.cloneDeep(collection); deepEqual(_.where(collection, { 'a': { 'b': { 'c': 1 } } }), expected); }); - test('should search of arrays for values', function() { + test('should search of arrays for values', 2, function() { var collection = [{ 'a': [1, 2] }], expected = _.cloneDeep(collection); @@ -4387,14 +4395,14 @@ }; _.forOwn(object, function(pair, key) { - test('should work with ' + key, function() { + test('should work with ' + key, 2, function() { var actual = _.zip.apply(_, pair[0]); deepEqual(actual, pair[1]); deepEqual(_.zip.apply(_, actual), actual.length ? pair[0] : []); }); }); - test('should work with tuples of different lengths', function() { + test('should work with tuples of different lengths', 4, function() { var pair = [ [['moe', 30], ['larry', 40, false]], [['moe', 'larry'], [30, 40], [undefined, false]] @@ -4409,7 +4417,7 @@ deepEqual(actual, [['moe', 30, undefined], ['larry', 40, false]]); }); - test('should correctly consume it\'s output', function() { + test('should correctly consume it\'s output', 1, function() { var expected = [['moe', 'larry'], [30, 40]]; deepEqual(_.zip(_.zip(_.zip(_.zip(expected)))), expected); }); @@ -4420,7 +4428,7 @@ QUnit.module('lodash.zipObject'); (function() { - test('should skip falsey elements in a given two dimensional array', function() { + test('should skip falsey elements in a given two dimensional array', 1, function() { var actual = _.zipObject([['a', 1], ['b', 2]].concat(falsey)); deepEqual(actual, { 'a': 1, 'b': 2 }); }); @@ -4431,7 +4439,7 @@ QUnit.module('lodash(...).shift'); (function() { - test('should remove the value at index `0` when length is `0` (test in IE 8 compatibility mode)', function() { + test('should remove the value at index `0` when length is `0` (test in IE 8 compatibility mode)', 2, function() { var wrapped = _({ '0': 1, 'length': 1 }); wrapped.shift(); @@ -4445,7 +4453,7 @@ QUnit.module('lodash(...).splice'); (function() { - test('should remove the value at index `0` when length is `0` (test in IE < 9, and in compatibility mode for IE9)', function() { + test('should remove the value at index `0` when length is `0` (test in IE < 9, and in compatibility mode for IE9)', 2, function() { var wrapped = _({ '0': 1, 'length': 1 }); wrapped.splice(0, 1); @@ -4459,7 +4467,7 @@ QUnit.module('lodash(...).toString'); (function() { - test('should return the `toString` result of the wrapped value', function() { + test('should return the `toString` result of the wrapped value', 1, function() { var wrapped = _([1, 2, 3]); equal(String(wrapped), '1,2,3'); }); @@ -4470,7 +4478,7 @@ QUnit.module('lodash(...).valueOf'); (function() { - test('should return the `valueOf` result of the wrapped value', function() { + test('should return the `valueOf` result of the wrapped value', 1, function() { var wrapped = _(123); equal(Number(wrapped), 123); }); @@ -4490,7 +4498,7 @@ ]; _.forEach(funcs, function(methodName) { - test('`_.' + methodName + '` should return a wrapped value', function() { + test('`_.' + methodName + '` should return a wrapped value', 1, function() { ok(wrapped[methodName]() instanceof _); }); }); @@ -4538,7 +4546,7 @@ ]; _.forEach(funcs, function(methodName) { - test('`_(...).' + methodName + '` should return an unwrapped value', function() { + test('`_(...).' + methodName + '` should return an unwrapped value', 1, function() { var result = methodName == 'reduceRight' ? wrapped[methodName](_.identity) : wrapped[methodName](); @@ -4563,15 +4571,15 @@ ]; _.forEach(funcs, function(methodName) { - test('`_(...).' + methodName + '` called without an `n` argument should return an unwrapped value', function() { + test('`_(...).' + methodName + '` called without an `n` argument should return an unwrapped value', 1, function() { equal(typeof wrapped[methodName](), 'number'); }); - test('`_(...).' + methodName + '` called with an `n` argument should return a wrapped value', function() { + test('`_(...).' + methodName + '` called with an `n` argument should return a wrapped value', 1, function() { ok(wrapped[methodName](1) instanceof _); }); - test('`_.' + methodName + '` should return `undefined` when querying falsey arguments without an `n` argument', function() { + test('`_.' + methodName + '` should return `undefined` when querying falsey arguments without an `n` argument', 1, function() { var actual = [], expected = _.map(falsey, function() { return undefined; }), func = _[methodName]; @@ -4585,7 +4593,7 @@ deepEqual(actual, expected); }); - test('`_.' + methodName + '` should return an empty array when querying falsey arguments with an `n` argument', function() { + test('`_.' + methodName + '` should return an empty array when querying falsey arguments with an `n` argument', 1, function() { var actual = [], expected = _.map(falsey, function() { return []; }), func = _[methodName]; @@ -4609,7 +4617,7 @@ var args = arguments, array = [1, 2, 3, 4, 5, 6]; - test('should work with `arguments` objects', function() { + test('should work with `arguments` objects', 23, function() { function message(methodName) { return '`_.' + methodName + '` should work with `arguments` objects'; } @@ -4646,7 +4654,7 @@ ok(args.length == 1 && _.isEqual(args[0], [3]), message('remove')); }); - test('should accept falsey primary arguments', function() { + test('should accept falsey primary arguments', 3, function() { function message(methodName) { return '`_.' + methodName + '` should accept falsey primary arguments'; } @@ -4656,7 +4664,7 @@ deepEqual(_.union(null, array), array, message('union')); }); - test('should accept falsey secondary arguments', function() { + test('should accept falsey secondary arguments', 3, function() { function message(methodName) { return '`_.' + methodName + '` should accept falsey secondary arguments'; } @@ -4724,7 +4732,7 @@ var acceptFalsey = _.difference(allMethods, rejectFalsey); - test('should accept falsey arguments', function() { + test('should accept falsey arguments', 147, function() { var isExported = '_' in root, oldDash = root._; @@ -4762,7 +4770,7 @@ } }); - test('should reject falsey arguments', function() { + test('should reject falsey arguments', 14, function() { _.forEach(rejectFalsey, function(methodName) { var actual = [], expected = _.map(falsey, function() { return true; }), @@ -4782,7 +4790,7 @@ }); }); - test('should handle `null` `thisArg` arguments', function() { + test('should handle `null` `thisArg` arguments', 30, function() { var thisArg, callback = function() { thisArg = this; }, expected = (function() { return this; }).call(null); diff --git a/vendor/qunit-clib/qunit-clib.js b/vendor/qunit-clib/qunit-clib.js index 5842ce7cc..acf368f7b 100644 --- a/vendor/qunit-clib/qunit-clib.js +++ b/vendor/qunit-clib/qunit-clib.js @@ -118,9 +118,38 @@ /** Used as a horizontal rule in console output */ var hr = '----------------------------------------'; + /** Used by `logInline` to clear previously logged messages */ + var prevLine = ''; + /** Shorten `context.QUnit.QUnit` to `context.QUnit` */ var QUnit = context.QUnit = context.QUnit.QUnit || context.QUnit; + /** + * Logs an inline message to standard output. + * + * @private + * @param {string} text The text to log. + */ + var logInline = (function() { + // exit early if not Node.js + if (!(typeof process == 'object' && process && process.on && process.stdout)) { + return function() {}; + } + // cleanup any inline logs when exited via `ctrl+c` + process.on('SIGINT', function() { + logInline(''); + process.exit(); + }); + return function(text) { + var blankLine = Array(prevLine.length + 1).join(' '); + if (text.length > hr.length) { + text = text.slice(0, hr.length - 3) + '...'; + } + prevLine = text; + process.stdout.write(text + blankLine.slice(text.length) + '\r'); + } + }()); + /** * A logging callback triggered when all testing is completed. * @@ -137,6 +166,7 @@ } ran = true; + logInline(''); console.log(hr); console.log(' PASS: ' + details.passed + ' FAIL: ' + details.failed + ' TOTAL: ' + details.total); console.log(' Finished in ' + details.runtime + ' milliseconds.'); @@ -230,6 +260,7 @@ testName = details.name; if (details.failed > 0) { + logInline(''); if (!modulePrinted) { modulePrinted = true; console.log(hr); @@ -240,6 +271,8 @@ assertions.forEach(function(value) { console.log(' ' + value); }); + } else { + logInline('Testing ' + moduleName + '...'); } assertions.length = 0; });