From 82b4f4147e35f96274e3543ce8857ac61dac3ad6 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 11:47:44 -0600 Subject: [PATCH] Add fp `customizer` test for `_.setWith`. --- test/test-fp.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test-fp.js b/test/test-fp.js index f76763de8..f8baa0751 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -904,7 +904,7 @@ object = { 'a': 1 }; QUnit.test('should provide the correct `customizer` arguments', function(assert) { - assert.expect(3); + assert.expect(4); var args, value = _.clone(object); @@ -939,6 +939,14 @@ args[5] = _.omitBy(args[5], _.isFunction); assert.deepEqual(args, expected, 'fp.mergeWith'); + + args = undefined; + value = _.clone(object); + actual = fp.setWith(function() { + args || (args = _.map(arguments, _.cloneDeep)); + }, 'b.c', 2, value); + + assert.deepEqual(args, [undefined, 'b', { 'a': 1 }], 'fp.setWith'); }); }());