From 2b54f23dad0508e7f2f5137b2b9fb8b4cfe453e5 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 2 May 2016 20:15:38 -0700 Subject: [PATCH] Add more stack tests. --- test/test.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/test/test.js b/test/test.js index df0f925f6..1c695bc04 100644 --- a/test/test.js +++ b/test/test.js @@ -2708,9 +2708,7 @@ var actual; _.cloneDeepWith({ 'a': 1 }, function() { - if (arguments.length > 1) { - actual || (actual = _.last(arguments)); - } + actual = _.last(arguments); }); assert.ok(actual instanceof mapCaches.Stack); @@ -10757,6 +10755,18 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should provide `stack` to `customizer`', function(assert) { + assert.expect(1); + + var actual; + + _.isMatchWith({ 'a': 1 }, { 'a': 1 }, function() { + actual = _.last(arguments); + }); + + assert.ok(actual instanceof mapCaches.Stack); + }); + QUnit.test('should ensure `customizer` is a function', function(assert) { assert.expect(1); @@ -15023,6 +15033,18 @@ assert.deepEqual(actual, { 'a': { 'b': [0, 1, 2] } }); }); + QUnit.test('should provide `stack` to `customizer`', function(assert) { + assert.expect(1); + + var actual; + + _.mergeWith({}, { 'a': { 'b': 1 } }, function() { + actual = _.last(arguments); + }); + + assert.ok(actual instanceof mapCaches.Stack); + }); + QUnit.test('should overwrite primitives with source object clones', function(assert) { assert.expect(1);