diff --git a/.gitignore b/.gitignore index ef37a96de..89f8a6bf9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ *.log doc/*.html node_modules -.idea diff --git a/test/test.js b/test/test.js index b324e1202..5c1930fa6 100644 --- a/test/test.js +++ b/test/test.js @@ -14830,7 +14830,7 @@ }()); /*--------------------------------------------------------------------------*/ -// sina + QUnit.module('lodash.merge'); (function() { @@ -14914,9 +14914,9 @@ QUnit.test('should merge first source object properties to function', function(assert) { assert.expect(1); - const Foo = function () {}; - var object = { prop: {} }, - actual = _.merge({prop: Foo}, object); + var fn = function() {}, + object = { 'prop': {} }, + actual = _.merge({ 'prop': fn }, object); assert.deepEqual(actual, object); }); @@ -14924,24 +14924,26 @@ QUnit.test('should merge first and second source object properties to function', function(assert) { assert.expect(1); - const fn = function () {}; - var object = { prop: {} }, - actual = _.merge({prop: fn}, {prop: fn}, object); + var fn = function() {}, + object = { 'prop': {} }, + actual = _.merge({ 'prop': fn }, { 'prop': fn }, object); assert.deepEqual(actual, object); }); QUnit.test('should not merge onto function values of sources', function(assert) { - assert.expect(2); + assert.expect(3); var source1 = { 'a': function() {} }, source2 = { 'a': { 'b': 2 } }, + expected = { 'a': { 'b': 2 } }, actual = _.merge({}, source1, source2); - assert.deepEqual(actual, { 'a': { 'b': 2 } }); + assert.deepEqual(actual, expected); + assert.notOk('b' in source1.a); actual = _.merge(source1, source2); - assert.strictEqual(actual.a.b, 2); + assert.deepEqual(actual, expected); }); QUnit.test('should merge onto non-plain `object` values', function(assert) {