Skip to content

Commit bde0288

Browse files
committed
avoid satisfies for type test
1 parent 3f82d47 commit bde0288

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

packages/toolkit/src/tests/createSlice.test.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -950,18 +950,19 @@ describe('createSlice', () => {
950950
const makeSliceWithHandler = (
951951
handle: ReducerCreator<typeof loaderCreatorType>['handle'],
952952
) => {
953+
const loaderCreator: ReducerCreator<typeof loaderCreatorType> = {
954+
type: loaderCreatorType,
955+
create(reducers) {
956+
return {
957+
_reducerDefinitionType: loaderCreatorType,
958+
...reducers,
959+
}
960+
},
961+
handle,
962+
}
953963
const createAppSlice = buildCreateSlice({
954964
creators: {
955-
loader: {
956-
type: loaderCreatorType,
957-
create(reducers) {
958-
return {
959-
_reducerDefinitionType: loaderCreatorType,
960-
...reducers,
961-
}
962-
},
963-
handle,
964-
} satisfies ReducerCreator<typeof loaderCreatorType>,
965+
loader: loaderCreator,
965966
},
966967
})
967968
return createAppSlice({
@@ -1086,7 +1087,9 @@ describe('createSlice', () => {
10861087
person.name = 'Charlie'
10871088
}),
10881089
),
1089-
).toThrowErrorMatchingInlineSnapshot(`[Error: Could not find "person" slice in state. In order for slice creators to use \`context.selectSlice\`, the slice must be nested in the state under its reducerPath: "person"]`)
1090+
).toThrowErrorMatchingInlineSnapshot(
1091+
`[Error: Could not find "person" slice in state. In order for slice creators to use \`context.selectSlice\`, the slice must be nested in the state under its reducerPath: "person"]`,
1092+
)
10901093
})
10911094
})
10921095
})

0 commit comments

Comments
 (0)