File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -284,9 +284,9 @@ export function createStore<
284284
285285 if ( typeof action . type !== 'string' ) {
286286 throw new Error (
287- `Action "type" property must be a string. Instead, the actual type was: ${ kindOf (
287+ `Action "type" property must be a string. Instead, the actual type was: ' ${ kindOf (
288288 action . type
289- ) } . `
289+ ) } '. Value was: ' ${ action . type } ' (stringified) `
290290 )
291291 }
292292
Original file line number Diff line number Diff line change @@ -575,16 +575,15 @@ describe('createStore', () => {
575575
576576 it ( 'throws if action type is not string' , ( ) => {
577577 const store = createStore ( reducers . todos )
578- const expectedErr = / A c t i o n " t y p e " p r o p e r t y m u s t b e a s t r i n g /
579578 expect ( ( ) =>
580579 store . dispatch ( { type : false } as unknown as AnyAction )
581- ) . toThrow ( expectedErr )
580+ ) . toThrow ( / t h e a c t u a l t y p e w a s : ' b o o l e a n ' . * V a l u e w a s : ' f a l s e ' / )
582581 expect ( ( ) => store . dispatch ( { type : 0 } as unknown as AnyAction ) ) . toThrow (
583- expectedErr
582+ / t h e a c t u a l t y p e w a s : ' n u m b e r ' . * V a l u e w a s : ' 0 ' /
584583 )
585584 expect ( ( ) =>
586585 store . dispatch ( { type : null } as unknown as AnyAction )
587- ) . toThrow ( expectedErr )
586+ ) . toThrow ( / t h e a c t u a l t y p e w a s : ' n u l l ' . * V a l u e w a s : ' n u l l ' / )
588587
589588 expect ( ( ) =>
590589 store . dispatch ( { type : '' } as unknown as AnyAction )
You can’t perform that action at this time.
0 commit comments