SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 0 JavaScript

toWarnInDev matcher; throw on unexpected console.error (#11786)

* Added toWarnInDev matcher and connected to 1 test
* Added .toLowPriorityWarnDev() matcher
* Reply Jest spy with custom spy. Unregister spy after toWarnDev() so unexpected console.error/warn calls will fail tests.
* console warn/error throws immediately in tests by default (if not spied on)
* Pass-thru console message before erroring to make it easier to identify
* More robustly handle unexpected warnings within try/catch
* Error message includes remaining expected warnings in addition to unexpected warning
B
Brian Vaughn committed
b5334a44e99c32ca26f7d65ca8312e13f7b7f4b7
Parent: 22e2bf7
Committed by GitHub <noreply@github.com> on 1/2/2018, 7:06:41 PM