|
378 | 378 |
|
379 | 379 | /*--------------------------------------------------------------------------*/
|
380 | 380 |
|
| 381 | + QUnit.module('strict mode checks'); |
| 382 | + |
381 | 383 | _.each(['bindAll', 'defaults', 'extend'], function(methodName) {
|
382 | 384 | var func = _[methodName];
|
383 |
| - QUnit.module('lodash.' + methodName + ' strict mode checks'); |
384 | 385 |
|
385 |
| - test('should not throw strict mode errors', function() { |
| 386 | + test('lodash.' + methodName + ' should not throw strict mode errors', function() { |
386 | 387 | var object = { 'a': null, 'b': function(){} },
|
387 | 388 | pass = true;
|
388 | 389 |
|
|
517 | 518 |
|
518 | 519 | /*--------------------------------------------------------------------------*/
|
519 | 520 |
|
| 521 | + QUnit.module('object iteration bugs'); |
| 522 | + |
520 | 523 | _.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
|
521 | 524 | var func = _[methodName];
|
522 |
| - QUnit.module('lodash.' + methodName + ' iteration bugs'); |
523 | 525 |
|
524 |
| - test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { |
| 526 | + test('lodash.' + methodName + ' fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { |
525 | 527 | var keys = [];
|
526 | 528 | func(shadowed, function(value, key) { keys.push(key); });
|
527 | 529 | deepEqual(keys.sort(), shadowedKeys);
|
528 | 530 | });
|
529 | 531 |
|
530 |
| - test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { |
| 532 | + test('lodash.' + methodName + ' skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { |
531 | 533 | function Foo() {}
|
532 | 534 | Foo.prototype.a = 1;
|
533 | 535 |
|
|
544 | 546 | });
|
545 | 547 | });
|
546 | 548 |
|
| 549 | + /*--------------------------------------------------------------------------*/ |
| 550 | + |
| 551 | + QUnit.module('exit early'); |
| 552 | + |
547 | 553 | _.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
|
548 | 554 | var func = _[methodName];
|
549 |
| - QUnit.module('lodash.' + methodName + ' can exit early'); |
550 | 555 |
|
551 |
| - test('can exit early when iterating arrays', function() { |
| 556 | + test('lodash.' + methodName + ' can exit early when iterating arrays', function() { |
552 | 557 | var array = [1, 2, 3],
|
553 | 558 | values = [];
|
554 | 559 |
|
555 | 560 | func(array, function(value) { values.push(value); return false; });
|
556 | 561 | deepEqual(values, [1]);
|
557 | 562 | });
|
558 | 563 |
|
559 |
| - test('can exit early when iterating objects', function() { |
| 564 | + test('lodash.' + methodName + ' can exit early when iterating objects', function() { |
560 | 565 | var object = { 'a': 1, 'b': 2, 'c': 3 },
|
561 | 566 | values = [];
|
562 | 567 |
|
|
798 | 803 |
|
799 | 804 | /*--------------------------------------------------------------------------*/
|
800 | 805 |
|
| 806 | + QUnit.module('isType checks'); |
| 807 | + |
801 | 808 | _.each([
|
802 | 809 | 'isArguments',
|
803 | 810 | 'isArray',
|
|
817 | 824 | 'isUndefined'
|
818 | 825 | ], function(methodName) {
|
819 | 826 | var func = _[methodName];
|
820 |
| - QUnit.module('lodash.' + methodName + ' result'); |
821 | 827 |
|
822 |
| - test('should return a boolean', function() { |
| 828 | + test('lodash.' + methodName + ' should return a boolean', function() { |
823 | 829 | var expected = 'boolean';
|
824 | 830 |
|
825 | 831 | equal(typeof func(arguments), expected);
|
|
0 commit comments