mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fail tests on errors in renderer
This commit is contained in:
@@ -15,6 +15,15 @@ env.beforeEach(() => {
|
||||
// Fake timers let us flush Bridge operations between setup and assertions.
|
||||
jest.useFakeTimers();
|
||||
|
||||
const originalConsoleError = console.error;
|
||||
console.error = (...args) => {
|
||||
if (args[0] === 'Warning: React DevTools encountered an error: %s') {
|
||||
// Rethrow errors from React.
|
||||
throw args[1];
|
||||
}
|
||||
originalConsoleError.apply(console, args);
|
||||
};
|
||||
|
||||
installHook(global);
|
||||
|
||||
const bridgeListeners = [];
|
||||
|
||||
Reference in New Issue
Block a user