fbjs
fbjs copied to clipboard
Fail tests when not spying on warning()
In React we fail tests when there are unexpected calls to warning(). This makes sure than any warnings are intentional. If a test does something that results in a warning, we spyOn console.error. We aren't doing that here but we probably should (will need to figure out if we can take some of the logic we have internally or if we have to recreate it, the React way might be hackier than the internal way).