From b3a6e4b67c9d055b6e14bca773c0f7bf8de7c822 Mon Sep 17 00:00:00 2001 From: Orlando Date: Sat, 23 Mar 2024 22:33:29 +0000 Subject: [PATCH] one more test --- src/helpers/setObjectPath.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/helpers/setObjectPath.test.ts b/src/helpers/setObjectPath.test.ts index a0f5b98..63b8dac 100644 --- a/src/helpers/setObjectPath.test.ts +++ b/src/helpers/setObjectPath.test.ts @@ -38,4 +38,17 @@ describe("setObjectPath", () => { }, }); }); + + test("merges nested", () => { + const obj = { a: { b: { c: 1 } } }; + setObjectPath(obj, "a.b.g", { lol: 1 }); + expect(obj).toEqual({ + a: { + b: { + c: 1, + g: { lol: 1 }, + }, + }, + }); + }); });