Commit 063c042 Jack Pope
committed
1 parent 147a267 commit 063c042 Copy full SHA for 063c042
File tree 4 files changed +19
-3
lines changed
4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,7 @@ export const enableInfiniteRenderLoopDetection = true;
187
187
// during element creation.
188
188
export const enableRefAsProp = __NEXT_MAJOR__ ;
189
189
190
- // Not ready to break experimental yet.
191
- // Needs more internal cleanup
190
+ // Set to next major in ReactFeatureFlags.test-renderer
192
191
// Warn on any usage of ReactTestRenderer
193
192
export const enableReactTestRendererWarning = false ;
194
193
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ export const enableInfiniteRenderLoopDetection = false;
98
98
// flags should be handled by the Fiber config.
99
99
const __NEXT_MAJOR__ = __EXPERIMENTAL__ ;
100
100
export const enableRefAsProp = __NEXT_MAJOR__ ;
101
- export const enableReactTestRendererWarning = false ;
101
+ export const enableReactTestRendererWarning = __NEXT_MAJOR__ ;
102
102
103
103
// Flow magic to verify the exports of this file match the original version.
104
104
( ( ( ( null : any ) : ExportsType ) : FeatureFlagsType ) : ExportsType ) ;
Original file line number Diff line number Diff line change 3
3
const chalk = require ( 'chalk' ) ;
4
4
const util = require ( 'util' ) ;
5
5
const shouldIgnoreConsoleError = require ( './shouldIgnoreConsoleError' ) ;
6
+ const shouldIgnoreConsoleWarn = require ( './shouldIgnoreConsoleWarn' ) ;
6
7
const { getTestFlags} = require ( './TestFlags' ) ;
7
8
8
9
if ( process . env . REACT_CLASS_EQUIVALENCE_TEST ) {
@@ -71,6 +72,11 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
71
72
return ;
72
73
}
73
74
75
+ // Ignore certain React warnings causing test failures
76
+ if ( methodName === 'warn' && shouldIgnoreConsoleWarn ( format ) ) {
77
+ return ;
78
+ }
79
+
74
80
// Capture the call stack now so we can warn about it later.
75
81
// The call stack has helpful information for the test author.
76
82
// Don't throw yet though b'c it might be accidentally caught and suppressed.
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ module . exports = function shouldIgnoreConsoleWarn ( format ) {
4
+ if ( typeof format === 'string' ) {
5
+ if ( format . indexOf ( 'Warning: react-test-renderer is deprecated.' ) === 0 ) {
6
+ return true ;
7
+ }
8
+ }
9
+
10
+ return false ;
11
+ } ;
You can’t perform that action at this time.
0 commit comments