Skip to content

Commit

Permalink
test(simple object): add testing about 'markSimpleObject' add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Dec 23, 2023
1 parent 2d0e181 commit 0aba178
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
isDraft,
Draft,
markSimpleObject,
rawReturn,
} from '../src';
import { PROXY_DRAFT } from '../src/constant';

Expand Down Expand Up @@ -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);
});

0 comments on commit 0aba178

Please sign in to comment.