From 5c82a28eddaed7a69f4d47dfc9c70edf307e0788 Mon Sep 17 00:00:00 2001 From: Conor Hawes Date: Sun, 2 Jul 2023 17:26:59 -0400 Subject: [PATCH] Update error message syntax --- packages/toolkit/src/mapBuilders.ts | 2 +- packages/toolkit/src/tests/createReducer.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/toolkit/src/mapBuilders.ts b/packages/toolkit/src/mapBuilders.ts index 151ad6c545..90bbe7d50e 100644 --- a/packages/toolkit/src/mapBuilders.ts +++ b/packages/toolkit/src/mapBuilders.ts @@ -166,7 +166,7 @@ export function executeReducerBuilderCallback( } if (type in actionsMap) { throw new Error( - 'addCase cannot be called with two reducers for the same action type' + '`builder.addCase` cannot be called with two reducers for the same action type' ) } actionsMap[type] = reducer diff --git a/packages/toolkit/src/tests/createReducer.test.ts b/packages/toolkit/src/tests/createReducer.test.ts index 9a4652936e..4fb840f696 100644 --- a/packages/toolkit/src/tests/createReducer.test.ts +++ b/packages/toolkit/src/tests/createReducer.test.ts @@ -460,7 +460,7 @@ describe('createReducer', () => { .addCase(decrement, (state, action) => state - action.payload) ) ).toThrowErrorMatchingInlineSnapshot( - `"addCase cannot be called with two reducers for the same action type"` + '"`builder.addCase` cannot be called with two reducers for the same action type"' ) expect(() => createReducer(0, (builder) => @@ -470,7 +470,7 @@ describe('createReducer', () => { .addCase(decrement, (state, action) => state - action.payload) ) ).toThrowErrorMatchingInlineSnapshot( - `"addCase cannot be called with two reducers for the same action type"` + '"`builder.addCase` cannot be called with two reducers for the same action type"' ) })