Skip to content

Commit 0d530b1

Browse files
committed
Update snapshots
1 parent d66e83b commit 0d530b1

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

packages/toolkit/src/query/tests/apiProvider.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('ApiProvider', () => {
6767
</Provider>
6868
)
6969
).toThrowErrorMatchingInlineSnapshot(
70-
'"Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup."'
70+
`[Error: Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup.]`
7171
)
7272
})
7373
})

packages/toolkit/src/query/tests/buildCreateApi.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ describe('buildCreateApi', () => {
120120
}
121121

122122
expect(callBuildCreateApi).toThrowErrorMatchingInlineSnapshot(
123-
`"When using custom hooks for context, all 3 hooks need to be provided: useDispatch, useSelector, useStore.\nHook useStore was either not provided or not a function."`
123+
`
124+
[Error: When using custom hooks for context, all 3 hooks need to be provided: useDispatch, useSelector, useStore.
125+
Hook useStore was either not provided or not a function.]
126+
`
124127
)
125128
})
126129
})

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ describe('createReducer', () => {
306306
)
307307
)
308308
expect(() => reducer(5, decrement(5))).toThrowErrorMatchingInlineSnapshot(
309-
`"A case reducer on a non-draftable value must not return undefined"`
309+
`[Error: A case reducer on a non-draftable value must not return undefined]`
310310
)
311311
})
312312
test('allows you to return undefined if the state was null, thus skipping an update', () => {
@@ -354,7 +354,7 @@ describe('createReducer', () => {
354354
.addCase(decrement, (state, action) => state - action.payload)
355355
)
356356
).toThrowErrorMatchingInlineSnapshot(
357-
'"`builder.addCase` cannot be called with two reducers for the same action type \'increment\'"'
357+
`[Error: \`builder.addCase\` cannot be called with two reducers for the same action type 'increment']`
358358
)
359359
expect(() =>
360360
createReducer(0, (builder) =>
@@ -364,7 +364,7 @@ describe('createReducer', () => {
364364
.addCase(decrement, (state, action) => state - action.payload)
365365
)
366366
).toThrowErrorMatchingInlineSnapshot(
367-
'"`builder.addCase` cannot be called with two reducers for the same action type \'increment\'"'
367+
`[Error: \`builder.addCase\` cannot be called with two reducers for the same action type 'increment']`
368368
)
369369
})
370370

@@ -382,7 +382,7 @@ describe('createReducer', () => {
382382
)
383383
)
384384
).toThrowErrorMatchingInlineSnapshot(
385-
'"`builder.addCase` cannot be called with an empty action type"'
385+
`[Error: \`builder.addCase\` cannot be called with an empty action type]`
386386
)
387387
})
388388
})
@@ -507,14 +507,14 @@ describe('createReducer', () => {
507507
.addCase(incrementBy, () => {})
508508
)
509509
).toThrowErrorMatchingInlineSnapshot(
510-
`"\`builder.addCase\` should only be called before calling \`builder.addMatcher\`"`
510+
`[Error: \`builder.addCase\` should only be called before calling \`builder.addMatcher\`]`
511511
)
512512
expect(() =>
513513
createReducer(initialState, (builder: any) =>
514514
builder.addDefaultCase(() => {}).addCase(incrementBy, () => {})
515515
)
516516
).toThrowErrorMatchingInlineSnapshot(
517-
`"\`builder.addCase\` should only be called before calling \`builder.addDefaultCase\`"`
517+
`[Error: \`builder.addCase\` should only be called before calling \`builder.addDefaultCase\`]`
518518
)
519519
expect(() =>
520520
createReducer(initialState, (builder: any) =>
@@ -523,14 +523,14 @@ describe('createReducer', () => {
523523
.addMatcher(numberActionMatcher, () => {})
524524
)
525525
).toThrowErrorMatchingInlineSnapshot(
526-
`"\`builder.addMatcher\` should only be called before calling \`builder.addDefaultCase\`"`
526+
`[Error: \`builder.addMatcher\` should only be called before calling \`builder.addDefaultCase\`]`
527527
)
528528
expect(() =>
529529
createReducer(initialState, (builder: any) =>
530530
builder.addDefaultCase(() => {}).addDefaultCase(() => {})
531531
)
532532
).toThrowErrorMatchingInlineSnapshot(
533-
`"\`builder.addDefaultCase\` can only be called once"`
533+
`[Error: \`builder.addDefaultCase\` can only be called once]`
534534
)
535535
})
536536
})

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ describe('createSlice', () => {
252252
})
253253
slice.reducer(undefined, { type: 'unrelated' })
254254
}).toThrowErrorMatchingInlineSnapshot(
255-
'"`builder.addCase` cannot be called with two reducers for the same action type \'increment\'"'
255+
`[Error: \`builder.addCase\` cannot be called with two reducers for the same action type 'increment']`
256256
)
257257
})
258258

@@ -587,7 +587,7 @@ describe('createSlice', () => {
587587
reducers: (create) => ({ thunk: create.asyncThunk(() => {}) }),
588588
})
589589
).toThrowErrorMatchingInlineSnapshot(
590-
'"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`."'
590+
`[Error: Cannot use \`create.asyncThunk\` in the built-in \`createSlice\`. Use \`buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })\` to create a customised version of \`createSlice\`.]`
591591
)
592592
})
593593
const createAppSlice = buildCreateSlice({
@@ -826,7 +826,7 @@ describe('createSlice', () => {
826826
}),
827827
})
828828
).toThrowErrorMatchingInlineSnapshot(
829-
`"Please use the \`create.preparedReducer\` notation for prepared action creators with the \`create\` notation."`
829+
`[Error: Please use the \`create.preparedReducer\` notation for prepared action creators with the \`create\` notation.]`
830830
)
831831
})
832832
})

0 commit comments

Comments
 (0)