We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f78f9d commit 9b1acb3Copy full SHA for 9b1acb3
packages/toolkit/src/tests/createAsyncThunk.test.ts
@@ -953,4 +953,18 @@ describe('meta', () => {
953
ret.meta.extraProp
954
}
955
})
956
+
957
+ test('typed createAsyncThunk.withTypes', () => {
958
+ const typedCAT = createAsyncThunk.withTypes<{
959
+ state: { s: string }
960
+ rejectValue: string
961
+ extra: { s: string; n: number }
962
+ }>()
963
+ const thunk = typedCAT('a', () => 'b')
964
+ const expectFunction = expect.any(Function)
965
+ expect(thunk.fulfilled).toEqual(expectFunction)
966
+ expect(thunk.pending).toEqual(expectFunction)
967
+ expect(thunk.rejected).toEqual(expectFunction)
968
+ expect(thunk.fulfilled.type).toBe('a/fulfilled')
969
+ })
970
0 commit comments