From 28420ac1fc35fb0b77854c0082d992376332f5d6 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 27 Dec 2015 23:58:51 -0600 Subject: [PATCH] Add `_.conforms` test for missing `object` properties. --- test/test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test.js b/test/test.js index 74a9b8812..2cfe112e7 100644 --- a/test/test.js +++ b/test/test.js @@ -2760,6 +2760,19 @@ assert.deepEqual(actual, [objects[1], objects[2]]); }); + QUnit.test('should not invoke `source` predicates for missing `object` properties', function(assert) { + assert.expect(2); + + var count = 0; + + var conforms = _.conforms({ + 'a': function() { count++; return true; } + }); + + assert.strictEqual(conforms({}), false); + assert.strictEqual(count, 0); + }); + QUnit.test('should work with a function for `object`', function(assert) { assert.expect(2);