866
const message = expectToThrowFailure(() => {
867
expect(root).toMatchRenderedOutput(<div>foobarbaz</div>);
868
});
869
- expect(message).toMatchInlineSnapshot(`
870
- "asserConsoleLogsCleared(expected)
869
+ if (!__DEV__) {
870
+ expect(message).toMatchInlineSnapshot(`
871
+ "asserConsoleLogsCleared(expected)
872
872
- console.log was called without assertConsoleLogDev:
873
- + Not asserted
874
- + Not asserted
875
- + Not asserted
873
+ console.log was called without assertConsoleLogDev:
874
+ + Not asserted
875
+ + Not asserted
876
+ + Not asserted
877
877
- You must call one of the assertConsoleDev helpers between each act call."
878
- `);
878
+ You must call one of the assertConsoleDev helpers between each act call."
879
+ `);
880
+ } else if (gate(flags => flags.enableOwnerStacks)) {
881
+ expect(message).toMatchInlineSnapshot(`
882
+ "asserConsoleLogsCleared(expected)
883
+
884
+ console.log was called without assertConsoleLogDev:
885
+ + Not asserted
886
+ + Not asserted
887
+ + Not asserted
888
+
889
+ You must call one of the assertConsoleDev helpers between each act call."
890
+ `);
891
+ } else {
892
+ expect(message).toMatchInlineSnapshot(`
893
+ "asserConsoleLogsCleared(expected)
894
+
895
+ console.log was called without assertConsoleLogDev:
896
+ + Not asserted
897
+ + Not asserted
898
+ + Not asserted
899
+
900
+ You must call one of the assertConsoleDev helpers between each act call."
901
+ `);
902
+ }
903
904
expect(root).toMatchRenderedOutput(<div>foobarbaz</div>);
905
});
946
});
947
});
948
925
- expect(message).toMatchInlineSnapshot(`
926
- "asserConsoleLogsCleared(expected)
949
+ if (!__DEV__) {
950
+ expect(message).toMatchInlineSnapshot(`
951
+ "asserConsoleLogsCleared(expected)
952
928
- console.warn was called without assertConsoleWarnDev:
929
- + A
930
- + B
931
- + C
953
+ console.warn was called without assertConsoleWarnDev:
954
+ + A
955
+ + B
956
+ + C
957
933
- You must call one of the assertConsoleDev helpers between each act call."
934
- `);
958
+ You must call one of the assertConsoleDev helpers between each act call."
959
+ `);
960
+ } else if (gate(flags => flags.enableOwnerStacks)) {
961
+ expect(message).toMatchInlineSnapshot(`
962
+ "asserConsoleLogsCleared(expected)
963
+
964
+ console.warn was called without assertConsoleWarnDev:
965
+ + A%s,
966
+ + in App (at **)
967
+ + B%s,
968
+ + in App (at **)
969
+ + C%s,
970
+ + in App (at **)
971
+
972
+ You must call one of the assertConsoleDev helpers between each act call."
973
+ `);
974
+ } else {
975
+ expect(message).toMatchInlineSnapshot(`
976
+ "asserConsoleLogsCleared(expected)
977
+
978
+ console.warn was called without assertConsoleWarnDev:
979
+ + A%s,
980
+ + in Yield (at **)
981
+ + in div (at **)
982
+ + in App (at **)
983
+ + B%s,
984
+ + in Yield (at **)
985
+ + in div (at **)
986
+ + in App (at **)
987
+ + C%s,
988
+ + in Yield (at **)
989
+ + in div (at **)
990
+ + in App (at **)
991
+
992
+ You must call one of the assertConsoleDev helpers between each act call."
993
+ `);
994
+ }
995
});
996
997
it('fails if act is called without any assertConsoleDev helpers', async () => {
1022
});
1023
});
1024
965
- expect(message).toMatchInlineSnapshot(`
966
- "asserConsoleLogsCleared(expected)
1025
+ if (!__DEV__) {
1026
+ expect(message).toMatchInlineSnapshot(`
1027
+ "asserConsoleLogsCleared(expected)
1028
968
- console.log was called without assertConsoleLogDev:
969
- + A
970
- + B
971
- + C
1029
+ console.log was called without assertConsoleLogDev:
1030
+ + A
1031
+ + B
1032
+ + C
1033
973
- console.warn was called without assertConsoleWarnDev:
974
- + A
975
- + B
976
- + C
1034
+ console.warn was called without assertConsoleWarnDev:
1035
+ + A
1036
+ + B
1037
+ + C
1038
978
- console.error was called without assertConsoleErrorDev:
979
- + A
980
- + B
981
- + C
1039
+ console.error was called without assertConsoleErrorDev:
1040
+ + A
1041
+ + B
1042
+ + C
1043
983
- You must call one of the assertConsoleDev helpers between each act call."
984
- `);
1044
+ You must call one of the assertConsoleDev helpers between each act call."
1045
+ `);
1046
+ } else if (gate(flags => flags.enableOwnerStacks)) {
1047
+ expect(message).toMatchInlineSnapshot(`
1048
+ "asserConsoleLogsCleared(expected)
1049
+
1050
+ console.log was called without assertConsoleLogDev:
1051
+ + A
1052
+ + B
1053
+ + C
1054
+
1055
+ console.warn was called without assertConsoleWarnDev:
1056
+ + A%s,
1057
+ + in App (at **)
1058
+ + B%s,
1059
+ + in App (at **)
1060
+ + C%s,
1061
+ + in App (at **)
1062
+
1063
+ console.error was called without assertConsoleErrorDev:
1064
+ + A%s,
1065
+ + in App (at **)
1066
+ + B%s,
1067
+ + in App (at **)
1068
+ + C%s,
1069
+ + in App (at **)
1070
+
1071
+ You must call one of the assertConsoleDev helpers between each act call."
1072
+ `);
1073
+ } else {
1074
+ expect(message).toMatchInlineSnapshot(`
1075
+ "asserConsoleLogsCleared(expected)
1076
+
1077
+ console.log was called without assertConsoleLogDev:
1078
+ + A
1079
+ + B
1080
+ + C
1081
+
1082
+ console.warn was called without assertConsoleWarnDev:
1083
+ + A%s,
1084
+ + in Yield (at **)
1085
+ + in div (at **)
1086
+ + in App (at **)
1087
+ + B%s,
1088
+ + in Yield (at **)
1089
+ + in div (at **)
1090
+ + in App (at **)
1091
+ + C%s,
1092
+ + in Yield (at **)
1093
+ + in div (at **)
1094
+ + in App (at **)
1095
+
1096
+ console.error was called without assertConsoleErrorDev:
1097
+ + A%s,
1098
+ + in Yield (at **)
1099
+ + in div (at **)
1100
+ + in App (at **)
1101
+ + B%s,
1102
+ + in Yield (at **)
1103
+ + in div (at **)
1104
+ + in App (at **)
1105
+ + C%s,
1106
+ + in Yield (at **)
1107
+ + in div (at **)
1108
+ + in App (at **)
1109
+
1110
+ You must call one of the assertConsoleDev helpers between each act call."
1111
+ `);
1112
+ }
1113
});
1114
1115
// @gate __DEV__
1932
const message = expectToThrowFailure(() => {
1933
expect(root).toMatchRenderedOutput(<div>foobarbaz</div>);
1934
});
1807
- expect(message).toMatchInlineSnapshot(`
1808
- "asserConsoleLogsCleared(expected)
1935
+ if (!__DEV__) {
1936
+ expect(message).toMatchInlineSnapshot(`
1937
+ "asserConsoleLogsCleared(expected)
1938
1810
- console.warn was called without assertConsoleWarnDev:
1811
- + Not asserted
1812
- + Not asserted
1813
- + Not asserted
1939
+ console.warn was called without assertConsoleWarnDev:
1940
+ + Not asserted
1941
+ + Not asserted
1942
+ + Not asserted
1943
1815
- You must call one of the assertConsoleDev helpers between each act call."
1816
- `);
1944
+ You must call one of the assertConsoleDev helpers between each act call."
1945
+ `);
1946
+ } else if (gate(flags => flags.enableOwnerStacks)) {
1947
+ expect(message).toMatchInlineSnapshot(`
1948
+ "asserConsoleLogsCleared(expected)
1949
+
1950
+ console.warn was called without assertConsoleWarnDev:
1951
+ + Not asserted%s,
1952
+ + in Yield (at **)
1953
+ + Not asserted%s,
1954
+ + in Yield (at **)
1955
+ + Not asserted%s,
1956
+ + in Yield (at **)
1957
+
1958
+ You must call one of the assertConsoleDev helpers between each act call."
1959
+ `);
1960
+ } else {
1961
+ expect(message).toMatchInlineSnapshot(`
1962
+ "asserConsoleLogsCleared(expected)
1963
+
1964
+ console.warn was called without assertConsoleWarnDev:
1965
+ + Not asserted%s,
1966
+ + in Yield (at **)
1967
+ + in div (at **)
1968
+ + Not asserted%s,
1969
+ + in Yield (at **)
1970
+ + in div (at **)
1971
+ + Not asserted%s,
1972
+ + in Yield (at **)
1973
+ + in div (at **)
1974
+
1975
+ You must call one of the assertConsoleDev helpers between each act call."
1976
+ `);
1977
+ }
1978
1979
expect(root).toMatchRenderedOutput(<div>foobarbaz</div>);
1980
});
2021
});
2022
});
2023
1863
- expect(message).toMatchInlineSnapshot(`
1864
- "asserConsoleLogsCleared(expected)
2024
+ if (!__DEV__) {
2025
+ expect(message).toMatchInlineSnapshot(`
2026
+ "asserConsoleLogsCleared(expected)
2027
1866
- console.error was called without assertConsoleErrorDev:
1867
- + A
1868
- + B
1869
- + C
2028
+ console.error was called without assertConsoleErrorDev:
2029
+ + A
2030
+ + B
2031
+ + C
2032
1871
- You must call one of the assertConsoleDev helpers between each act call."
1872
- `);
2033
+ You must call one of the assertConsoleDev helpers between each act call."
2034
+ `);
2035
+ } else if (gate(flags => flags.enableOwnerStacks)) {
2036
+ expect(message).toMatchInlineSnapshot(`
2037
+ "asserConsoleLogsCleared(expected)
2038
+
2039
+ console.error was called without assertConsoleErrorDev:
2040
+ + A%s,
2041
+ + in App (at **)
2042
+ + B%s,
2043
+ + in App (at **)
2044
+ + C%s,
2045
+ + in App (at **)
2046
+
2047
+ You must call one of the assertConsoleDev helpers between each act call."
2048
+ `);
2049
+ } else {
2050
+ expect(message).toMatchInlineSnapshot(`
2051
+ "asserConsoleLogsCleared(expected)
2052
+
2053
+ console.error was called without assertConsoleErrorDev:
2054
+ + A%s,
2055
+ + in Yield (at **)
2056
+ + in div (at **)
2057
+ + in App (at **)
2058
+ + B%s,
2059
+ + in Yield (at **)
2060
+ + in div (at **)
2061
+ + in App (at **)
2062
+ + C%s,
2063
+ + in Yield (at **)
2064
+ + in div (at **)
2065
+ + in App (at **)
2066
+
2067
+ You must call one of the assertConsoleDev helpers between each act call."
2068
+ `);
2069
+ }
2070
});
2071
2072
it('fails if act is called without any assertConsoleDev helpers', async () => {
2097
});
2098
});
2099
1903
- expect(message).toMatchInlineSnapshot(`
1904
- "asserConsoleLogsCleared(expected)
2100
+ if (!__DEV__) {
2101
+ expect(message).toMatchInlineSnapshot(`
2102
+ "asserConsoleLogsCleared(expected)
2103
1906
- console.log was called without assertConsoleLogDev:
1907
- + A
1908
- + B
1909
- + C
2104
+ console.log was called without assertConsoleLogDev:
2105
+ + A
2106
+ + B
2107
+ + C
2108
1911
- console.warn was called without assertConsoleWarnDev:
1912
- + A
1913
- + B
1914
- + C
2109
+ console.warn was called without assertConsoleWarnDev:
2110
+ + A
2111
+ + B
2112
+ + C
2113
1916
- console.error was called without assertConsoleErrorDev:
1917
- + A
1918
- + B
1919
- + C
2114
+ console.error was called without assertConsoleErrorDev:
2115
+ + A
2116
+ + B
2117
+ + C
2118
1921
- You must call one of the assertConsoleDev helpers between each act call."
1922
- `);
2119
+ You must call one of the assertConsoleDev helpers between each act call."
2120
+ `);
2121
+ } else if (gate(flags => flags.enableOwnerStacks)) {
2122
+ expect(message).toMatchInlineSnapshot(`
2123
+ "asserConsoleLogsCleared(expected)
2124
+
2125
+ console.log was called without assertConsoleLogDev:
2126
+ + A
2127
+ + B
2128
+ + C
2129
+
2130
+ console.warn was called without assertConsoleWarnDev:
2131
+ + A%s,
2132
+ + in App (at **)
2133
+ + B%s,
2134
+ + in App (at **)
2135
+ + C%s,
2136
+ + in App (at **)
2137
+
2138
+ console.error was called without assertConsoleErrorDev:
2139
+ + A%s,
2140
+ + in App (at **)
2141
+ + B%s,
2142
+ + in App (at **)
2143
+ + C%s,
2144
+ + in App (at **)
2145
+
2146
+ You must call one of the assertConsoleDev helpers between each act call."
2147
+ `);
2148
+ } else {
2149
+ expect(message).toMatchInlineSnapshot(`
2150
+ "asserConsoleLogsCleared(expected)
2151
+
2152
+ console.log was called without assertConsoleLogDev:
2153
+ + A
2154
+ + B
2155
+ + C
2156
+
2157
+ console.warn was called without assertConsoleWarnDev:
2158
+ + A%s,
2159
+ + in Yield (at **)
2160
+ + in div (at **)
2161
+ + in App (at **)
2162
+ + B%s,
2163
+ + in Yield (at **)
2164
+ + in div (at **)
2165
+ + in App (at **)
2166
+ + C%s,
2167
+ + in Yield (at **)
2168
+ + in div (at **)
2169
+ + in App (at **)
2170
+
2171
+ console.error was called without assertConsoleErrorDev:
2172
+ + A%s,
2173
+ + in Yield (at **)
2174
+ + in div (at **)
2175
+ + in App (at **)
2176
+ + B%s,
2177
+ + in Yield (at **)
2178
+ + in div (at **)
2179
+ + in App (at **)
2180
+ + C%s,
2181
+ + in Yield (at **)
2182
+ + in div (at **)
2183
+ + in App (at **)
2184
+
2185
+ You must call one of the assertConsoleDev helpers between each act call."
2186
+ `);
2187
+ }
2188
});
2189
2190
// @gate __DEV__
3051
const message = expectToThrowFailure(() => {
3052
expect(root).toMatchRenderedOutput(<div>foobarbaz</div>);
3053
});
2789
- expect(message).toMatchInlineSnapshot(`
2790
- "asserConsoleLogsCleared(expected)
3054
+ if (!__DEV__) {
3055
+ expect(message).toMatchInlineSnapshot(`
3056
+ "asserConsoleLogsCleared(expected)
3057
2792
- console.error was called without assertConsoleErrorDev:
2793
- + Not asserted
2794
- + Not asserted
2795
- + Not asserted
3058
+ console.error was called without assertConsoleErrorDev:
3059
+ + Not asserted
3060
+ + Not asserted
3061
+ + Not asserted
3062
2797
- You must call one of the assertConsoleDev helpers between each act call."
2798
- `);
3063
+ You must call one of the assertConsoleDev helpers between each act call."
3064
+ `);
3065
+ } else if (gate(flags => flags.enableOwnerStacks)) {
3066
+ expect(message).toMatchInlineSnapshot(`
3067
+ "asserConsoleLogsCleared(expected)
3068
+
3069
+ console.error was called without assertConsoleErrorDev:
3070
+ + Not asserted%s,
3071
+ + in Yield (at **)
3072
+ + Not asserted%s,
3073
+ + in Yield (at **)
3074
+ + Not asserted%s,
3075
+ + in Yield (at **)
3076
+
3077
+ You must call one of the assertConsoleDev helpers between each act call."
3078
+ `);
3079
+ } else {
3080
+ expect(message).toMatchInlineSnapshot(`
3081
+ "asserConsoleLogsCleared(expected)
3082
+
3083
+ console.error was called without assertConsoleErrorDev:
3084
+ + Not asserted%s,
3085
+ + in Yield (at **)
3086
+ + in div (at **)
3087
+ + Not asserted%s,
3088
+ + in Yield (at **)
3089
+ + in div (at **)
3090
+ + Not asserted%s,
3091
+ + in Yield (at **)
3092
+ + in div (at **)
3093
+
3094
+ You must call one of the assertConsoleDev helpers between each act call."
3095
+ `);
3096
+ }
3097
3098
expect(root).toMatchRenderedOutput(<div>foobarbaz</div>);
3099
});