Fix broken lazy reverse

This commit is contained in:
Filip Zawada
2014-11-22 17:23:35 +01:00
parent 7e3dd2b8cc
commit 8f2b5e195e
2 changed files with 27 additions and 0 deletions

View File

@@ -12941,6 +12941,27 @@
skipTest(2);
}
});
test('should be lazy when in a lazy chain sequence', 1, function() {
if (!isNpm) {
var spy = {
toString: function () {
throw new Error("Spy was revealed");
}
};
var actual = _(["a", spy])
.map(String)
.reverse()
.last();
strictEqual(actual, "a");
}
else {
skipTest(1);
}
});
}());
/*--------------------------------------------------------------------------*/