Skip to content

Commit

Permalink
fix: add assertion for inner set and get types
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvander committed Aug 25, 2024
1 parent 3c5ac54 commit 1067033
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/middlewareTypes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ describe('counter state spec (single middleware)', () => {
inc: () =>
set((state) => {
state.count = get().count + 1
type OmitFn<T> = Exclude<T, (...args: any[]) => any>
expectTypeOf<
OmitFn<Parameters<typeof set>[0]>
>().not.toMatchTypeOf<{ additional: number }>()
expectTypeOf<ReturnType<typeof get>>().toMatchTypeOf<{
additional: number
}>()
}),
})),
),
Expand Down

0 comments on commit 1067033

Please sign in to comment.