mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Add explicit chaining support to Lo-Dash. [closes #325]
Former-commit-id: 58d01723ddc40f636af9954e5a9f6370e0c88aac
This commit is contained in:
13
test/test.js
13
test/test.js
@@ -408,6 +408,19 @@
|
||||
var wrapper = _({ 'a': 0 });
|
||||
equal(wrapper.chain(), wrapper);
|
||||
});
|
||||
|
||||
test('should enable chaining of methods that return unwrapped values by default', function() {
|
||||
var array = ['abc'];
|
||||
|
||||
ok(_.chain(array).first() instanceof _);
|
||||
ok(_(array).chain().first() instanceof _);
|
||||
|
||||
ok(_.chain(array).isArray() instanceof _);
|
||||
ok(_(array).chain().isArray() instanceof _);
|
||||
|
||||
ok(_.chain(array).first().first() instanceof _);
|
||||
ok(_(array).chain().first().first() instanceof _);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user