From 2008a8201788348e0ee9926680a5bb9ded14a513 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 24 Oct 2015 17:40:42 -0700 Subject: [PATCH] Add `_.conforms` test. --- test/test.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/test.js b/test/test.js index 11188050e..c83ddccbd 100644 --- a/test/test.js +++ b/test/test.js @@ -2491,6 +2491,26 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.conforms'); + + (function() { + QUnit.test('should create a function that checks if a given object conforms to `source`', function(assert) { + assert.expect(1); + + var objects = [ + { 'a': 1, 'b': 8 }, + { 'a': 2, 'b': 4 } + ]; + + var conforms = _.conforms({ 'b': function(value) { return value > 4; } }), + actual = lodashStable.filter(objects, conforms); + + assert.deepEqual(actual, [objects[0]]); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.conj'); (function() {