File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/react-devtools-shared/src/__tests__ Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,17 @@ env.beforeEach(() => {
27
27
const originalConsoleError = console . error ;
28
28
// $FlowFixMe
29
29
console . error = ( ...args ) => {
30
- if ( args [ 0 ] === 'Warning: React DevTools encountered an error: %s' ) {
30
+ const firstArg = args [ 0 ] ;
31
+ if ( firstArg === 'Warning: React DevTools encountered an error: %s' ) {
31
32
// Rethrow errors from React.
32
33
throw args [ 1 ] ;
34
+ } else if (
35
+ typeof firstArg === 'string' &&
36
+ firstArg . startsWith ( "Warning: It looks like you're using the wrong act()" )
37
+ ) {
38
+ // DevTools intentionally wraps updates with acts from both DOM and test-renderer,
39
+ // since test updates are expected to impact both renderers.
40
+ return ;
33
41
}
34
42
originalConsoleError . apply ( console , args ) ;
35
43
} ;
You can’t perform that action at this time.
0 commit comments