Skip to content

Commit 5c82a28

Browse files
committed
Update error message syntax
1 parent bdb60d8 commit 5c82a28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/toolkit/src/mapBuilders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function executeReducerBuilderCallback<S>(
166166
}
167167
if (type in actionsMap) {
168168
throw new Error(
169-
'addCase cannot be called with two reducers for the same action type'
169+
'`builder.addCase` cannot be called with two reducers for the same action type'
170170
)
171171
}
172172
actionsMap[type] = reducer

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ describe('createReducer', () => {
460460
.addCase(decrement, (state, action) => state - action.payload)
461461
)
462462
).toThrowErrorMatchingInlineSnapshot(
463-
`"addCase cannot be called with two reducers for the same action type"`
463+
'"`builder.addCase` cannot be called with two reducers for the same action type"'
464464
)
465465
expect(() =>
466466
createReducer(0, (builder) =>
@@ -470,7 +470,7 @@ describe('createReducer', () => {
470470
.addCase(decrement, (state, action) => state - action.payload)
471471
)
472472
).toThrowErrorMatchingInlineSnapshot(
473-
`"addCase cannot be called with two reducers for the same action type"`
473+
'"`builder.addCase` cannot be called with two reducers for the same action type"'
474474
)
475475
})
476476

0 commit comments

Comments
 (0)