Skip to content

Commit

Permalink
add more basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Oct 30, 2024
1 parent 4477cfe commit c6f5e9e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ it('should not change snapshot with modifying the original proxy', async () => {
expect(snap2.obj2.nested.count).toBe(2)
})

describe('snapsoht typings', () => {
it('should return stable nested snapshot object', async () => {
const state = proxy({ count: 0, obj: {} })
const snap1 = snapshot(state)
state.count++
const snap2 = snapshot(state)
expect(snap2.obj).toBe(snap1.obj)
})

describe('snapshot typings', () => {
it('converts object properties to readonly', () => {
expectType<
TypeEqual<
Expand Down

0 comments on commit c6f5e9e

Please sign in to comment.