Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ops] Add debug logging to certain jest error cases (elastic#175988)
## Summary We see quite frequently this kind of error in Jest unit tests: ``` Error: The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous. ``` As the test execution stops due to this runtime error, and the console logging is disabled in CI, we don't see a lot of the context of the error. This PR adds minimal extra logging when the case of this error happens.
- Loading branch information