Skip to content

Commit 41baf26

Browse files
committed
Add a test to check for null handling in wrapper methods
This could be considered a regression test for #2472.
1 parent 35579bc commit 41baf26

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/chaining.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,14 @@
9696
assert.strictEqual('' + wrapped, '512');
9797
});
9898

99+
QUnit.test('wrapper methods handle undefined and null', function(assert) {
100+
var w1 = _(), w2 = _(null);
101+
_.each([w1, w2], function(wrapped) {
102+
assert.equal(wrapped.extend({a: 1}), void 0);
103+
assert.equal(wrapped.first(), void 0);
104+
assert.equal(wrapped.push(1), void 0);
105+
assert.equal(wrapped.concat([1]), void 0);
106+
});
107+
});
108+
99109
}());

0 commit comments

Comments
 (0)