mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Add more lazy chaining tests.
This commit is contained in:
20
test/test.js
20
test/test.js
@@ -4087,6 +4087,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
test('should work in a lazy chain sequence with `drop`', 1, function() {
|
||||
var actual = _(array)
|
||||
.dropWhile(function(num) { return num == 1; })
|
||||
.drop()
|
||||
.dropWhile(function(num) { return num == 3; })
|
||||
.value();
|
||||
|
||||
deepEqual(actual, [4]);
|
||||
});
|
||||
|
||||
test('should provide the correct `predicate` arguments in a lazy chain sequence', 4, function() {
|
||||
if (!isNpm) {
|
||||
var args,
|
||||
@@ -5021,6 +5031,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
test('should work in a lazy chain sequence with `take`', 1, function() {
|
||||
var actual = _(array)
|
||||
.takeWhile(function(num) { return num < 4; })
|
||||
.take(2)
|
||||
.takeWhile(function(num) { return num == 1; })
|
||||
.value();
|
||||
|
||||
deepEqual(actual, [1]);
|
||||
});
|
||||
|
||||
test('should provide the correct `predicate` arguments in a lazy chain sequence', 4, function() {
|
||||
if (!isNpm) {
|
||||
var args,
|
||||
|
||||
Reference in New Issue
Block a user