Skip to content

Commit 11ed168

Browse files
committed
Update createAsyncThunk tests to match API changes
1 parent 4940605 commit 11ed168

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/createAsyncThunk.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('createAsyncThunk', () => {
2020

2121
const thunkActionCreator = createAsyncThunk(
2222
'testType',
23-
async ({ args }) => {
23+
async (args: number) => {
2424
passedArgs = args
2525
return result
2626
}
@@ -51,14 +51,16 @@ describe('createAsyncThunk', () => {
5151
it('accepts arguments and dispatches the actions on reject', async () => {
5252
const dispatch = jest.fn()
5353

54-
let passedArgs: any
5554
const args = 123
5655

5756
const error = new Error('Panic!')
5857

59-
const thunkActionCreator = createAsyncThunk('testType', async () => {
60-
throw error
61-
})
58+
const thunkActionCreator = createAsyncThunk(
59+
'testType',
60+
async (args: number) => {
61+
throw error
62+
}
63+
)
6264

6365
const thunkFunction = thunkActionCreator(args)
6466

0 commit comments

Comments
 (0)