Add more lazy chaining tests.

This commit is contained in:
jdalton
2015-03-02 21:22:13 -08:00
parent 913778d5ab
commit 5991068fdf

View File

@@ -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,