Skip to content

Commit

Permalink
test(set-map): update
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Nov 23, 2024
1 parent 9410f7d commit 259445c
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions test/immer-non-support.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,17 +672,11 @@ test('CustomSet', () => {
}

const state = new CustomSet();
const newState = create(
state,
(draft) => {
draft.add(1);
// @ts-ignore
expect(draft.getIdentity()).toBe('CustomSet');
},
{
mark: () => 'immutable',
}
);
const newState = create(state, (draft) => {
draft.add(1);
// @ts-ignore
expect(draft.getIdentity()).toBe('CustomSet');
});
expect(newState instanceof CustomSet).toBeTruthy();
// @ts-ignore
expect(newState.getIdentity()).toBe('CustomSet');
Expand Down Expand Up @@ -717,17 +711,11 @@ test('CustomMap', () => {
}

const state = new CustomMap();
const newState = create(
state,
(draft) => {
draft.set(1, 1);
// @ts-ignore
expect(draft.getIdentity()).toBe('CustomMap');
},
{
mark: () => 'immutable',
}
);
const newState = create(state, (draft) => {
draft.set(1, 1);
// @ts-ignore
expect(draft.getIdentity()).toBe('CustomMap');
});
expect(newState instanceof CustomMap).toBeTruthy();
// @ts-ignore
expect(newState.getIdentity()).toBe('CustomMap');
Expand Down

0 comments on commit 259445c

Please sign in to comment.