Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit bb910f7

Browse files
committed
test: add test for merge function
1 parent 531a4ac commit bb910f7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/test/utils.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const { deepObjectValues, flatten, invariant } = require('../utils');
22

33
const {
4+
merge,
5+
omit,
46
percentage,
57
toPx,
68
toEm,
@@ -13,6 +15,18 @@ const {
1315
isValidStep,
1416
} = require('../utils');
1517

18+
describe('merge', () => {
19+
it('merge all transfered objects', () => {
20+
expect(merge({ a: 1 }, { b: 2 }, { c: 3 })).toEqual({ a: 1, b: 2, c: 3 });
21+
});
22+
});
23+
24+
describe('omit', () => {
25+
it('return object without a parameter passed', () => {
26+
expect(omit('a', { a: 1, b: 2 })).toEqual({ b: 2 });
27+
});
28+
});
29+
1630
describe('deepObjectValues', () => {
1731
it('return an array of a values from the object', () => {
1832
const config = {

0 commit comments

Comments
 (0)