@@ -13,7 +13,7 @@ describe('createSlice', () => {
1313 restore = mockConsole ( createConsole ( ) )
1414 } )
1515
16- describe ( 'when slice is undefined' , ( ) => {
16+ describe ( 'when name is undefined' , ( ) => {
1717 it ( 'should throw an error' , ( ) => {
1818 expect ( ( ) =>
1919 // @ts -ignore
@@ -29,7 +29,7 @@ describe('createSlice', () => {
2929 } )
3030 } )
3131
32- describe ( 'when slice is an empty string' , ( ) => {
32+ describe ( 'when name is an empty string' , ( ) => {
3333 it ( 'should throw an error' , ( ) => {
3434 expect ( ( ) =>
3535 createSlice ( {
@@ -47,17 +47,17 @@ describe('createSlice', () => {
4747
4848 describe ( 'when initial state is undefined' , ( ) => {
4949 it ( 'should throw an error' , ( ) => {
50- createSlice ( {
51- name : 'test' ,
52- reducers : { } ,
53- initialState : undefined ,
54- } )
55-
56- expect ( getLog ( ) . log ) . toBe ( 'initial state must be different of undefined')
50+ expect ( ( ) =>
51+ // @ts -ignore
52+ createSlice ( {
53+ name : 'test' ,
54+ reducers : { } ,
55+ } )
56+ ) . toThrowError ( 'You must provide an `initialState` value that is not ` undefined`. You may have misspelled `initialState` ')
5757 } )
5858 } )
5959
60- describe ( 'when passing slice ' , ( ) => {
60+ describe ( 'when passing name ' , ( ) => {
6161 const { actions, reducer, caseReducers } = createSlice ( {
6262 reducers : {
6363 increment : ( state ) => state + 1 ,
0 commit comments