diff --git a/apps/app/src/lib/__tests__/util.test.ts b/apps/app/src/lib/__tests__/util.test.ts new file mode 100644 index 00000000..2aff587c --- /dev/null +++ b/apps/app/src/lib/__tests__/util.test.ts @@ -0,0 +1,22 @@ +import { deepExtendRemovingUndefined } from '../util' + +test('deepExtendRemovingUndefined', () => { + { + const target = { + a: 1, + } + deepExtendRemovingUndefined(target, { + b: 2, + }) + expect(target).toStrictEqual({ a: 1, b: 2 }) + } + { + const target = { + a: [1, 2, 3], + } + deepExtendRemovingUndefined(target, { + a: [4, 5, 6], + }) + expect(target).toStrictEqual({ a: [4, 5, 6] }) + } +})