From 4528311d7782f4f960cc52a60431b91470a17e15 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 1 Dec 2014 21:53:24 -0800 Subject: [PATCH] Add `_.create` and `_.includes` tests. --- test/test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test.js b/test/test.js index cc3b7bcb2..a1945f31b 100644 --- a/test/test.js +++ b/test/test.js @@ -2159,6 +2159,16 @@ deepEqual(Circle.prototype, expected); }); + test('should assign own properties', 1, function() { + function Foo() { + this.a = 1; + this.c = 3; + } + Foo.prototype.b = 2; + + deepEqual(_.create({}, new Foo), { 'a': 1, 'c': 3 }); + }); + test('should accept a falsey `prototype` argument', 1, function() { var expected = _.map(falsey, _.constant({})); @@ -5025,6 +5035,18 @@ }); }); + test('should return `false` for empty collections', 1, function() { + var expected = _.map(empties, _.constant(false)); + + var actual = _.map(empties, function(value) { + try { + return _.includes(value); + } catch(e) {} + }); + + deepEqual(actual, expected); + }); + test('should not be possible to perform a binary search', 1, function() { strictEqual(_.includes([3, 2, 1], 3, true), true); });