Skip to content

Commit

Permalink
fix(test): add testing
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Nov 9, 2023
1 parent d480a46 commit bc77b24
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3359,3 +3359,15 @@ test('map: assigning a non-draft array', () => {

expect(state.data.size).toBe(0);
});

test('#20 - Filter does not work correctly when array contains objects', () => {
const baseState = {
array: [{ x: 1 }],
};

const state = create(baseState, (draft) => {
draft.array = draft.array.filter((o) => o.x !== 1);
});

expect(state.array).toEqual([]);
});

0 comments on commit bc77b24

Please sign in to comment.