"use strict";

var _deepMerge = _interopRequireDefault(require("../deep-merge.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
describe('deepMerge', function () {
  test('performs deep merge on target', function () {
    var target = {
      foo: {
        bar: {
          baz: true,
          quux: true
        }
      }
    };
    var source = {
      foo: {
        bar: {
          baz: false
        }
      }
    };
    var ret = (0, _deepMerge.default)(target, source);
    expect(ret).toBe(target);
    expect(target).toEqual({
      foo: {
        bar: {
          baz: false,
          quux: true
        }
      }
    });
  });
  test('can handle three way merge', function () {
    var target = {
      foo: 1,
      bar: 2
    };
    var source1 = {
      foo: 2,
      baz: 3
    };
    var source2 = {
      foo: 3,
      quux: 4
    };
    var ret = (0, _deepMerge.default)({}, target, source1, source2);
    expect(ret).toEqual({
      foo: 3,
      bar: 2,
      baz: 3,
      quux: 4
    });
  });
});