From 4c7e4afb866843be986dead422e88279c5c256af Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Wed, 20 Mar 2024 11:46:21 -0700 Subject: [PATCH] Revert "do not mock console functions globaly but noopify them" This reverts commit 913b11e2959e20014b093910f8661da1dc7a2b2e. --- jest.setup.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/jest.setup.js b/jest.setup.js index b662755c6ea..05fbee97db1 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -1,14 +1,12 @@ // Suppress console messages printing during unit tests. // Comment out log level as necessary (e.g. while debugging tests) -const noop = () => undefined; - global.console = { ...console, - log: noop, - debug: noop, - info: noop, - warn: noop, - error: noop, + log: jest.fn(), + debug: jest.fn(), + info: jest.fn(), + warn: jest.fn(), + error: jest.fn(), }; // React Native global