Skip to content

Commit

Permalink
use correct tester
Browse files Browse the repository at this point in the history
  • Loading branch information
charkour committed Dec 8, 2023
1 parent 8b61255 commit 602c0ae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions tests/__tests__/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('Middleware options', () => {
boolean1: true,
boolean2: false,
});
expect(store.getState()).toContain({ count: 2, count2: 2 });
expect(store.getState()).toMatchObject({ count: 2, count2: 2 });
});

it('should partialize the past states', () => {
Expand All @@ -137,7 +137,7 @@ describe('Middleware options', () => {
expect(storeWithPartialize.temporal.getState().pastStates[1]).toEqual({
count: 1,
});
expect(storeWithPartialize.getState()).toContain({ count: 2, count2: 2 });
expect(storeWithPartialize.getState()).toMatchObject({ count: 2, count2: 2 });
});

it('should partialize the future states', () => {
Expand Down Expand Up @@ -210,10 +210,10 @@ describe('Middleware options', () => {
increment();
});
expect(store.temporal.getState().pastStates.length).toBe(5);
expect(store.temporal.getState().pastStates[0]).toContain({
expect(store.temporal.getState().pastStates[0]).toMatchObject({
count: 0,
});
expect(store.temporal.getState().pastStates[2]).toContain({
expect(store.temporal.getState().pastStates[2]).toMatchObject({
count: 2,
});
});
Expand All @@ -229,10 +229,10 @@ describe('Middleware options', () => {
increment();
});
expect(storeWithLimit.temporal.getState().pastStates.length).toBe(3);
expect(storeWithLimit.temporal.getState().pastStates[0]).toContain({
expect(storeWithLimit.temporal.getState().pastStates[0]).toMatchObject({
count: 2,
});
expect(storeWithLimit.temporal.getState().pastStates[2]).toContain({
expect(storeWithLimit.temporal.getState().pastStates[2]).toMatchObject({
count: 4,
});
});
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('Middleware options', () => {
count: 1,
count2: 1,
});
expect(storeWithDiff.getState()).toContain({
expect(storeWithDiff.getState()).toMatchObject({
count: 2,
count2: 2,
});
Expand All @@ -358,7 +358,7 @@ describe('Middleware options', () => {
expect(storeWithDiff.temporal.getState().pastStates[2]).toEqual({
count2: 2,
});
expect(storeWithDiff.getState()).toContain({
expect(storeWithDiff.getState()).toMatchObject({
count: 2,
count2: 3,
});
Expand All @@ -370,7 +370,7 @@ describe('Middleware options', () => {
expect(storeWithDiff.temporal.getState().pastStates[3]).toEqual({
count2: 3,
});
expect(storeWithDiff.getState()).toContain({
expect(storeWithDiff.getState()).toMatchObject({
count: 2,
count2: 4,
});
Expand All @@ -389,7 +389,7 @@ describe('Middleware options', () => {
expect(storeWithDiff.temporal.getState().futureStates[1]).toEqual({
count2: 3,
});
expect(storeWithDiff.getState()).toContain({
expect(storeWithDiff.getState()).toMatchObject({
count: 2,
count2: 2,
});
Expand All @@ -412,7 +412,7 @@ describe('Middleware options', () => {
count: 2,
count2: 2,
});
expect(storeWithDiff.getState()).toContain({
expect(storeWithDiff.getState()).toMatchObject({
count: 1,
count2: 1,
});
Expand All @@ -431,7 +431,7 @@ describe('Middleware options', () => {
expect(storeWithDiff.temporal.getState().futureStates[1]).toEqual({
count2: 3,
});
expect(storeWithDiff.getState()).toContain({
expect(storeWithDiff.getState()).toMatchObject({
count: 2,
count2: 2,
});
Expand All @@ -444,7 +444,7 @@ describe('Middleware options', () => {
count2: 0,
});
expect(storeWithDiff.temporal.getState().futureStates.length).toBe(0);
expect(storeWithDiff.getState()).toContain({
expect(storeWithDiff.getState()).toMatchObject({
count: 2,
count2: 4,
});
Expand Down Expand Up @@ -564,10 +564,10 @@ describe('Middleware options', () => {
increment();
doNothing();
});
expect(storeWithHandleSet.temporal.getState().pastStates[0]).toContain({
expect(storeWithHandleSet.temporal.getState().pastStates[0]).toMatchObject({
count: 0,
});
expect(storeWithHandleSet.temporal.getState().pastStates[1]).toContain({
expect(storeWithHandleSet.temporal.getState().pastStates[1]).toMatchObject({
count: 1,
});
expect(storeWithHandleSet.temporal.getState().pastStates.length).toBe(2);
Expand Down Expand Up @@ -600,10 +600,10 @@ describe('Middleware options', () => {
increment();
doNothing();
});
expect(storeWithHandleSet.temporal.getState().pastStates[0]).toContain({
expect(storeWithHandleSet.temporal.getState().pastStates[0]).toMatchObject({
count: 0,
});
expect(storeWithHandleSet.temporal.getState().pastStates[1]).toContain({
expect(storeWithHandleSet.temporal.getState().pastStates[1]).toMatchObject({
count: 1,
});
expect(storeWithHandleSet.temporal.getState().pastStates.length).toBe(2);
Expand Down
6 changes: 3 additions & 3 deletions tests/__tests__/zundo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,17 +347,17 @@ describe('temporal middleware', () => {
store.getState().increment();
});
expect(store.temporal.getState().pastStates.length).toBe(0);
expect(store.getState()).toContain({ count: 1, count2: 1 });
expect(store.getState()).toMatchObject({ count: 1, count2: 1 });
act(() => {
resume();
store.getState().increment();
});
expect(store.temporal.getState().pastStates.length).toBe(1);
expect(store.temporal.getState().pastStates[0]).toContain({
expect(store.temporal.getState().pastStates[0]).toMatchObject({
count: 1,
count2: 1,
});
expect(store.getState()).toContain({ count: 2, count2: 2 });
expect(store.getState()).toMatchObject({ count: 2, count2: 2 });
});
});

Expand Down

0 comments on commit 602c0ae

Please sign in to comment.