From 30fe1209ede399313c5e43bab931cf19bb29abcd Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Fri, 20 Oct 2023 15:22:06 +0200 Subject: [PATCH] chore: add test --- apps/app/src/lib/__tests__/util.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 apps/app/src/lib/__tests__/util.test.ts 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] }) + } +})