Files
30-seconds-of-code/test/merge/merge.test.js
2018-06-18 15:54:48 +03:00

22 lines
440 B
JavaScript

const expect = require('expect');
const merge = require('./merge.js');
test('merge is a Function', () => {
expect(merge).toBeInstanceOf(Function);
});
const object = {
a: [{ x: 2 }, { y: 4 }],
b: 1
};
const other = {
a: { z: 3 },
b: [2, 3],
c: 'foo'
};
test('Merges two objects', () => {
expect(merge(object, other), { a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }).toEqual()
});