@@ -998,77 +998,114 @@ describe('React', () => {
998
998
999
999
function AwesomeMap ( ) { }
1000
1000
1001
- expect ( ( ) => {
1002
- TestUtils . renderIntoDocument (
1003
- < ProviderMock store = { store } >
1004
- { makeContainer ( ( ) => 1 , ( ) => ( { } ) , ( ) => ( { } ) ) }
1005
- </ ProviderMock >
1006
- )
1007
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m a p S t a t e / )
1001
+ let spy = expect . spyOn ( console , 'error' )
1002
+ TestUtils . renderIntoDocument (
1003
+ < ProviderMock store = { store } >
1004
+ { makeContainer ( ( ) => 1 , ( ) => ( { } ) , ( ) => ( { } ) ) }
1005
+ </ ProviderMock >
1006
+ )
1007
+ expect ( spy . calls . length ) . toBe ( 1 )
1008
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1009
+ / m a p S t a t e T o P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1010
+ )
1011
+ spy . destroy ( )
1008
1012
1009
- expect ( ( ) => {
1010
- TestUtils . renderIntoDocument (
1011
- < ProviderMock store = { store } >
1012
- { makeContainer ( ( ) => 'hey' , ( ) => ( { } ) , ( ) => ( { } ) ) }
1013
- </ ProviderMock >
1014
- )
1015
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m a p S t a t e / )
1013
+ spy = expect . spyOn ( console , 'error' )
1014
+ TestUtils . renderIntoDocument (
1015
+ < ProviderMock store = { store } >
1016
+ { makeContainer ( ( ) => 'hey' , ( ) => ( { } ) , ( ) => ( { } ) ) }
1017
+ </ ProviderMock >
1018
+ )
1019
+ expect ( spy . calls . length ) . toBe ( 1 )
1020
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1021
+ / m a p S t a t e T o P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1022
+ )
1023
+ spy . destroy ( )
1016
1024
1017
- expect ( ( ) => {
1018
- TestUtils . renderIntoDocument (
1019
- < ProviderMock store = { store } >
1020
- { makeContainer ( ( ) => new AwesomeMap ( ) , ( ) => ( { } ) , ( ) => ( { } ) ) }
1021
- </ ProviderMock >
1022
- )
1023
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m a p S t a t e / )
1025
+ spy = expect . spyOn ( console , 'error' )
1026
+ TestUtils . renderIntoDocument (
1027
+ < ProviderMock store = { store } >
1028
+ { makeContainer ( ( ) => new AwesomeMap ( ) , ( ) => ( { } ) , ( ) => ( { } ) ) }
1029
+ </ ProviderMock >
1030
+ )
1031
+ expect ( spy . calls . length ) . toBe ( 1 )
1032
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1033
+ / m a p S t a t e T o P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1034
+ )
1035
+ spy . destroy ( )
1024
1036
1025
- expect ( ( ) => {
1026
- TestUtils . renderIntoDocument (
1027
- < ProviderMock store = { store } >
1028
- { makeContainer ( ( ) => ( { } ) , ( ) => 1 , ( ) => ( { } ) ) }
1029
- </ ProviderMock >
1030
- )
1031
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m a p D i s p a t c h / )
1037
+ spy = expect . spyOn ( console , 'error' )
1038
+ TestUtils . renderIntoDocument (
1039
+ < ProviderMock store = { store } >
1040
+ { makeContainer ( ( ) => ( { } ) , ( ) => 1 , ( ) => ( { } ) ) }
1041
+ </ ProviderMock >
1042
+ )
1043
+ expect ( spy . calls . length ) . toBe ( 1 )
1044
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1045
+ / m a p D i s p a t c h T o P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1046
+ )
1047
+ spy . destroy ( )
1032
1048
1033
- expect ( ( ) => {
1034
- TestUtils . renderIntoDocument (
1035
- < ProviderMock store = { store } >
1036
- { makeContainer ( ( ) => ( { } ) , ( ) => 'hey' , ( ) => ( { } ) ) }
1037
- </ ProviderMock >
1038
- )
1039
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m a p D i s p a t c h / )
1049
+ spy = expect . spyOn ( console , 'error' )
1050
+ TestUtils . renderIntoDocument (
1051
+ < ProviderMock store = { store } >
1052
+ { makeContainer ( ( ) => ( { } ) , ( ) => 'hey' , ( ) => ( { } ) ) }
1053
+ </ ProviderMock >
1054
+ )
1055
+ expect ( spy . calls . length ) . toBe ( 1 )
1056
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1057
+ / m a p D i s p a t c h T o P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1058
+ )
1059
+ spy . destroy ( )
1040
1060
1041
- expect ( ( ) => {
1042
- TestUtils . renderIntoDocument (
1043
- < ProviderMock store = { store } >
1044
- { makeContainer ( ( ) => ( { } ) , ( ) => new AwesomeMap ( ) , ( ) => ( { } ) ) }
1045
- </ ProviderMock >
1046
- )
1047
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m a p D i s p a t c h / )
1061
+ spy = expect . spyOn ( console , 'error' )
1062
+ TestUtils . renderIntoDocument (
1063
+ < ProviderMock store = { store } >
1064
+ { makeContainer ( ( ) => ( { } ) , ( ) => new AwesomeMap ( ) , ( ) => ( { } ) ) }
1065
+ </ ProviderMock >
1066
+ )
1067
+ expect ( spy . calls . length ) . toBe ( 1 )
1068
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1069
+ / m a p D i s p a t c h T o P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1070
+ )
1071
+ spy . destroy ( )
1048
1072
1049
- expect ( ( ) => {
1050
- TestUtils . renderIntoDocument (
1051
- < ProviderMock store = { store } >
1052
- { makeContainer ( ( ) => ( { } ) , ( ) => ( { } ) , ( ) => 1 ) }
1053
- </ ProviderMock >
1054
- )
1055
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m e r g e P r o p s / )
1073
+ spy = expect . spyOn ( console , 'error' )
1074
+ TestUtils . renderIntoDocument (
1075
+ < ProviderMock store = { store } >
1076
+ { makeContainer ( ( ) => ( { } ) , ( ) => ( { } ) , ( ) => 1 ) }
1077
+ </ ProviderMock >
1078
+ )
1079
+ expect ( spy . calls . length ) . toBe ( 1 )
1080
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1081
+ / m e r g e P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1082
+ )
1083
+ spy . destroy ( )
1056
1084
1057
- expect ( ( ) => {
1058
- TestUtils . renderIntoDocument (
1059
- < ProviderMock store = { store } >
1060
- { makeContainer ( ( ) => ( { } ) , ( ) => ( { } ) , ( ) => 'hey' ) }
1061
- </ ProviderMock >
1062
- )
1063
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m e r g e P r o p s / )
1064
1085
1065
- expect ( ( ) => {
1066
- TestUtils . renderIntoDocument (
1067
- < ProviderMock store = { store } >
1068
- { makeContainer ( ( ) => ( { } ) , ( ) => ( { } ) , ( ) => new AwesomeMap ( ) ) }
1069
- </ ProviderMock >
1070
- )
1071
- } ) . toThrow ( / C o n n e c t \( C o n t a i n e r \) m e r g e P r o p s / )
1086
+ spy = expect . spyOn ( console , 'error' )
1087
+ TestUtils . renderIntoDocument (
1088
+ < ProviderMock store = { store } >
1089
+ { makeContainer ( ( ) => ( { } ) , ( ) => ( { } ) , ( ) => 'hey' ) }
1090
+ </ ProviderMock >
1091
+ )
1092
+ expect ( spy . calls . length ) . toBe ( 1 )
1093
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1094
+ / m e r g e P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1095
+ )
1096
+ spy . destroy ( )
1097
+
1098
+ spy = expect . spyOn ( console , 'error' )
1099
+ TestUtils . renderIntoDocument (
1100
+ < ProviderMock store = { store } >
1101
+ { makeContainer ( ( ) => ( { } ) , ( ) => ( { } ) , ( ) => new AwesomeMap ( ) ) }
1102
+ </ ProviderMock >
1103
+ )
1104
+ expect ( spy . calls . length ) . toBe ( 1 )
1105
+ expect ( spy . calls [ 0 ] . arguments [ 0 ] ) . toMatch (
1106
+ / m e r g e P r o p s \( \) i n C o n n e c t \( C o n t a i n e r \) m u s t r e t u r n a p l a i n o b j e c t /
1107
+ )
1108
+ spy . destroy ( )
1072
1109
} )
1073
1110
1074
1111
it ( 'should recalculate the state and rebind the actions on hot update' , ( ) => {
0 commit comments