dillon1000/react

Commit

Remove global mocks by adding support for "suppressReactErrorLogging" property (#11636)

* Remove global mocks

They are making it harder to test compiled bundles.

One of them (FeatureFlags) is not used. It is mocked in some specific test files (and that's fine).

The other (FiberErrorLogger) is mocked to silence its output. I'll look if there's some other way to achieve this.

* Add error.suppressReactErrorLogging and use it in tests

This adds an escape hatch to *not* log errors that go through React to the console.
We will enable it for our own tests.
Browse files
Changed paths6 files
First-parent comparison
M package.json ModifiedM packages/react-reconciler/src/ReactFiberErrorLogger.js ModifiedM packages/react-reconciler/src/ReactFiberScheduler.js ModifiedM packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.js ModifiedM scripts/jest/environment.js ModifiedD scripts/jest/setup.js Deleted
Patch

Files changed

Rendering syntax-highlighted changes…