@@ -345,24 +345,24 @@ describe('createReducer', () => {
345
345
expect ( reducer ( 5 , decrement ( 5 ) ) ) . toBe ( 0 )
346
346
} )
347
347
test ( 'will throw if the same type is used twice' , ( ) => {
348
- expect ( ( ) =>
349
- createReducer ( 0 , ( builder ) =>
348
+ expect ( ( ) => {
349
+ createReducer ( 0 , ( builder ) => {
350
350
builder
351
351
. addCase ( increment , ( state , action ) => state + action . payload )
352
352
. addCase ( increment , ( state , action ) => state + action . payload )
353
- . addCase ( decrement , ( state , action ) => state - action . payload ) ,
354
- ) ,
355
- ) . toThrowErrorMatchingInlineSnapshot (
353
+ . addCase ( decrement , ( state , action ) => state - action . payload )
354
+ } )
355
+ } ) . toThrowErrorMatchingInlineSnapshot (
356
356
`[Error: \`builder.addCase\` cannot be called with two reducers for the same action type 'increment']` ,
357
357
)
358
- expect ( ( ) =>
359
- createReducer ( 0 , ( builder ) =>
358
+ expect ( ( ) => {
359
+ createReducer ( 0 , ( builder ) => {
360
360
builder
361
361
. addCase ( increment , ( state , action ) => state + action . payload )
362
362
. addCase ( 'increment' , ( state ) => state + 1 )
363
- . addCase ( decrement , ( state , action ) => state - action . payload ) ,
364
- ) ,
365
- ) . toThrowErrorMatchingInlineSnapshot (
363
+ . addCase ( decrement , ( state , action ) => state - action . payload )
364
+ } )
365
+ } ) . toThrowErrorMatchingInlineSnapshot (
366
366
`[Error: \`builder.addCase\` cannot be called with two reducers for the same action type 'increment']` ,
367
367
)
368
368
} )
@@ -373,14 +373,14 @@ describe('createReducer', () => {
373
373
payload,
374
374
} )
375
375
customActionCreator . type = ''
376
- expect ( ( ) =>
377
- createReducer ( 0 , ( builder ) =>
376
+ expect ( ( ) => {
377
+ createReducer ( 0 , ( builder ) => {
378
378
builder . addCase (
379
379
customActionCreator ,
380
380
( state , action ) => state + action . payload ,
381
- ) ,
382
- ) ,
383
- ) . toThrowErrorMatchingInlineSnapshot (
381
+ )
382
+ } )
383
+ } ) . toThrowErrorMatchingInlineSnapshot (
384
384
`[Error: \`builder.addCase\` cannot be called with an empty action type]` ,
385
385
)
386
386
} )
0 commit comments