From 10fae1a04e1eb65a07c18deab2d6ba4b1914644e Mon Sep 17 00:00:00 2001 From: Ben Durrant Date: Sat, 4 May 2024 12:59:02 +0100 Subject: [PATCH] fix test --- packages/toolkit/src/tests/createSlice.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/toolkit/src/tests/createSlice.test.ts b/packages/toolkit/src/tests/createSlice.test.ts index 3f6bdc5d90..123b86ad06 100644 --- a/packages/toolkit/src/tests/createSlice.test.ts +++ b/packages/toolkit/src/tests/createSlice.test.ts @@ -678,7 +678,7 @@ describe('createSlice', () => { initialState: [] as any[], reducers: (create) => ({ thunkReducers: create.asyncThunk( - function payloadCreator(arg, api) { + function payloadCreator(arg: string, api) { return Promise.resolve('resolved payload') }, { pending, fulfilled, rejected, settled }, @@ -722,7 +722,7 @@ describe('createSlice', () => { reducers: (create) => ({ thunkReducers: create.asyncThunk( // payloadCreator isn't allowed to return never - function payloadCreator(arg, api): any { + function payloadCreator(arg: string, api): any { throw new Error('') }, { pending, fulfilled, rejected, settled }, @@ -765,7 +765,7 @@ describe('createSlice', () => { initialState: [] as any[], reducers: (create) => ({ thunkReducers: create.asyncThunk( - function payloadCreator(arg, api) { + function payloadCreator(arg: string, api) { return 'should not call this' }, { @@ -833,7 +833,6 @@ describe('createSlice', () => { slice.actions.thunkReducers.rejected( new Error('test'), 'fakeRequestId', - {}, ), ), ).not.toThrow()