utils/ts-src/mergeWithoutNulls.test.ts

26 lines
440 B
TypeScript

import { mergeWithoutNulls} from "./mergeWithoutNulls";
test('It should merge object correctly', function () {
const a = {a:1,b:2};
const b = {c:3,d:4};
expect(mergeWithoutNulls(a,b)).toEqual(({a:1,b:2, c:3, d:4}));
});
test('It should merge an object with nulls correctly', function () {
const a = {a:1,b:2};
const b = {c:3,d:4, e:null, f:null};
expect(mergeWithoutNulls(a,b)).toEqual(({a:1,b:2, c:3, d:4}));
});