@@ -2181,7 +2181,7 @@ describe('React', () => {
2181
2181
2182
2182
const decorator = connect ( ( state ) => {
2183
2183
actualState = state
2184
- return { }
2184
+ return { a : 42 }
2185
2185
} )
2186
2186
const Decorated = decorator ( Container )
2187
2187
@@ -2829,45 +2829,50 @@ describe('React', () => {
2829
2829
}
2830
2830
2831
2831
it ( 'should throw a helpful error for invalid mapStateToProps arguments' , ( ) => {
2832
- //@ts -expect-error
2833
- @connect ( 'invalid' )
2834
2832
class InvalidMapState extends React . Component {
2835
2833
render ( ) {
2836
2834
return < div />
2837
2835
}
2838
2836
}
2839
2837
2840
- const error = renderWithBadConnect ( InvalidMapState )
2838
+ //@ts -expect-error
2839
+ // eslint-disable-next-line
2840
+ const Connected = connect ( 'invalid' ) ( InvalidMapState )
2841
+
2842
+ const error = renderWithBadConnect ( Connected )
2841
2843
expect ( error ) . toContain ( 'string' )
2842
2844
expect ( error ) . toContain ( 'mapStateToProps' )
2843
2845
expect ( error ) . toContain ( 'InvalidMapState' )
2844
2846
} )
2845
2847
2846
2848
it ( 'should throw a helpful error for invalid mapDispatchToProps arguments' , ( ) => {
2847
- //@ts -expect-error
2848
- @connect ( null , 'invalid' )
2849
2849
class InvalidMapDispatch extends React . Component {
2850
2850
render ( ) {
2851
2851
return < div />
2852
2852
}
2853
2853
}
2854
2854
2855
- const error = renderWithBadConnect ( InvalidMapDispatch )
2855
+ // eslint-disable-next-line
2856
+ const Connected = connect ( null , 'invalid' ) ( InvalidMapDispatch )
2857
+
2858
+ const error = renderWithBadConnect ( Connected )
2856
2859
expect ( error ) . toContain ( 'string' )
2857
2860
expect ( error ) . toContain ( 'mapDispatchToProps' )
2858
2861
expect ( error ) . toContain ( 'InvalidMapDispatch' )
2859
2862
} )
2860
2863
2861
2864
it ( 'should throw a helpful error for invalid mergeProps arguments' , ( ) => {
2862
- // @ts -expect-error
2863
- @connect ( null , null , 'invalid' )
2864
2865
class InvalidMerge extends React . Component {
2865
2866
render ( ) {
2866
2867
return < div />
2867
2868
}
2868
2869
}
2869
2870
2870
- const error = renderWithBadConnect ( InvalidMerge )
2871
+ // @ts -expect-error
2872
+ // eslint-disable-next-line
2873
+ const Connected = connect ( null , null , 'invalid' ) ( InvalidMerge )
2874
+
2875
+ const error = renderWithBadConnect ( Connected )
2871
2876
expect ( error ) . toContain ( 'string' )
2872
2877
expect ( error ) . toContain ( 'mergeProps' )
2873
2878
expect ( error ) . toContain ( 'InvalidMerge' )
0 commit comments