Skip to content

Commit

Permalink
Reenable console.log in tests
Browse files Browse the repository at this point in the history
Summary:
D41564032 made `console.log` (as well as `debug` and `info`) a noop in tests within the React Native repo. Here we allow them through while still throwing errors on `console.error` and `console.warn`.

Changelog: [Internal]

Differential Revision: D51002264
  • Loading branch information
motiz88 authored and facebook-github-bot committed Nov 6, 2023
1 parent c637f06 commit c564a40
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/react-native/jest/local-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ require('./setup');
const consoleError = console.error;
const consoleWarn = console.warn;

// Blackhole verbose console output
console.debug = jest.fn();
console.info = jest.fn();
console.log = jest.fn();

console.error = (...args) => {
consoleError(...args);
throw new Error('console.error() was called (see error above)');
Expand Down

0 comments on commit c564a40

Please sign in to comment.