From 0aba178db2b5b962796f6b83c3e8bd731957311d Mon Sep 17 00:00:00 2001 From: unadlib Date: Sun, 24 Dec 2023 03:02:12 +0800 Subject: [PATCH] test(simple object): add testing about 'markSimpleObject' add null check --- test/index.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/index.test.ts b/test/index.test.ts index f644aa4b..81e444d3 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -12,6 +12,7 @@ import { isDraft, Draft, markSimpleObject, + rawReturn, } from '../src'; import { PROXY_DRAFT } from '../src/constant'; @@ -3775,3 +3776,12 @@ test('base check mark function - Multiple mark config', () => { }).toThrowError(); }); }); + +test(`'markSimpleObject' add null check`, () => { + const obj = {}; + const state = create(null as any, () => rawReturn(obj), { + mark: markSimpleObject, + }); + + expect(state).toEqual(obj); +});