mirror of
https://github.com/facebook/react.git
synced 2026-02-24 04:33:04 +00:00
While writing tests for unsafe async warnings, I noticed that in certain cases, errors were swallowed by the toWarnDev matcher and resulted in confusing test failures. For example, if an error prevented the code being tested from logging an expected warning- the test would fail saying that the warning hadn't been logged rather than reporting the unexpected error. I think a better approach for this is to always treat caught errors as the highest-priority reason for failing a test. I reran all of the test cases for this matcher that I originally ran with PR #11786 and ensured they all still pass.