8000 Reorganize tests. · lodash/lodash@bc0b924 · GitHub
[go: up one dir, main page]

Skip to content

Commit bc0b924

Browse files
committed
Reorganize tests.
Former-commit-id: 5293cdc1206af20824e8aec86b892afd4badf639
1 parent 56ad6af commit bc0b924

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

test/test.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,12 @@
378378

379379
/*--------------------------------------------------------------------------*/
380380

381+
QUnit.module('strict mode checks');
382+
381383
_.each(['bindAll', 'defaults', 'extend'], function(methodName) {
382384
var func = _[methodName];
383-
QUnit.module('lodash.' + methodName + ' strict mode checks');
384385

385-
test('should not throw strict mode errors', function() {
386+
test('lodash.' + methodName + ' should not throw strict mode errors', function() {
386387
var object = { 'a': null, 'b': function(){} },
387388
pass = true;
388389

@@ -517,17 +518,18 @@
517518

518519
/*--------------------------------------------------------------------------*/
519520

521+
QUnit.module('object iteration bugs');
522+
520523
_.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
521524
var func = _[methodName];
522-
QUnit.module('lodash.' + methodName + ' iteration bugs');
523525

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() {
525527
var keys = [];
526528
func(shadowed, function(value, key) { keys.push(key); });
527529
deepEqual(keys.sort(), shadowedKeys);
528530
});
529531

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() {
531533
function Foo() {}
532534
Foo.prototype.a = 1;
533535

@@ -544,19 +546,22 @@
544546
});
545547
});
546548

549+
/*--------------------------------------------------------------------------*/
550+
551+
QUnit.module('exit early');
552+
547553
_.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
548554
var func = _[methodName];
549-
QUnit.module('lodash.' + methodName + ' can exit early');
550555

551-
test('can exit early when iterating arrays', function() {
556+
test('lodash.' + methodName + ' can exit early when iterating arrays', function() {
552557
var array = [1, 2, 3],
553558
values = [];
554559

555560
func(array, function(value) { values.push(value); return false; });
556561
deepEqual(values, [1]);
557562
});
558563

559-
test('can exit early when iterating objects', function() {
564+
test('lodash.' + methodName + ' can exit early when iterating objects', function() {
560565
var object = { 'a': 1, 'b': 2, 'c': 3 },
561566
values = [];
562567

@@ -798,6 +803,8 @@
798803

799804
/*--------------------------------------------------------------------------*/
800805

806+
QUnit.module('isType checks');
807+
801808
_.each([
802809
'isArguments',
803810
'isArray',
@@ -817,9 +824,8 @@
817824
'isUndefined'
818825
], function(methodName) {
819826
var func = _[methodName];
820-
QUnit.module('lodash.' + methodName + ' result');
821827

822-
test('should return a boolean', function() {
828+
test('lodash.' + methodName + ' should return a boolean', function() {
823829
var expected = 'boolean';
824830

825831
equal(typeof func(arguments), expected);

0 commit comments

Comments
 (0)
0