Skip to content

Commit 7aa3933

Browse files
committed
test symbol errors
1 parent 1f1ac68 commit 7aa3933

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,15 @@ describe('createSlice', () => {
738738
},
739739
}
740740
test('allows passing custom reducer creators, which can add actions and case reducers', () => {
741+
expect(() =>
742+
createSlice({
743+
name: 'loader',
744+
initialState: {} as Partial<Record<string, true>>,
745+
reducers: () => ({
746+
addLoader: loaderCreator.create({}),
747+
}),
748+
}),
749+
).toThrowErrorMatchingInlineSnapshot(`[Error: Unsupported reducer type: Symbol(loaderCreatorType)]`)
741750
const createAppSlice = buildCreateSlice({
742751
creators: { loader: loaderCreator },
743752
})

0 commit comments

Comments
 (0)