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(() => {
2727 const originalConsoleError = console . error ;
2828 // $FlowFixMe
2929 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' ) {
3132 // Rethrow errors from React.
3233 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 ;
3341 }
3442 originalConsoleError . apply ( console , args ) ;
3543 } ;
You can’t perform that action at this time.
0 commit comments