From 1067033da7bf2a611284140da3b464824de7b798 Mon Sep 17 00:00:00 2001 From: Christian van der Loo Date: Sun, 25 Aug 2024 09:00:47 -0400 Subject: [PATCH] fix: add assertion for inner `set` and `get` types --- tests/middlewareTypes.test.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/middlewareTypes.test.tsx b/tests/middlewareTypes.test.tsx index e87c5f62ab..d38fa40e6e 100644 --- a/tests/middlewareTypes.test.tsx +++ b/tests/middlewareTypes.test.tsx @@ -96,6 +96,13 @@ describe('counter state spec (single middleware)', () => { inc: () => set((state) => { state.count = get().count + 1 + type OmitFn = Exclude any> + expectTypeOf< + OmitFn[0]> + >().not.toMatchTypeOf<{ additional: number }>() + expectTypeOf>().toMatchTypeOf<{ + additional: number + }>() }), })), ),