From 4a24a3c190165d75795ef18ac3606895ce820b5a Mon Sep 17 00:00:00 2001 From: Ming Ye Date: Sat, 28 Jan 2023 13:06:50 +0800 Subject: [PATCH] chore: retain mock implementation --- .../src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js b/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js index a63a87f29dc1..b1138f5a4b3b 100644 --- a/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js +++ b/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js @@ -67,8 +67,8 @@ module.exports = function(initModules) { // performs fn asynchronously and expects count errors logged to console.error. // will fail the test if the count of errors logged is not equal to count. async function expectErrors(fn, count) { - if (console.error.mockReset) { - console.error.mockReset(); + if (console.error.mockClear) { + console.error.mockClear(); } else { // TODO: Rewrite tests that use this helper to enumerate expected errors. // This will enable the helper to use the .toErrorDev() matcher instead of spying.