diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js
index 97e29ced26679..55956ddc93ecd 100644
--- a/packages/react-client/src/__tests__/ReactFlight-test.js
+++ b/packages/react-client/src/__tests__/ReactFlight-test.js
@@ -2108,6 +2108,7 @@ describe('ReactFlight', () => {
throw new Error('err');
}
+ // These tests are specifically testing console.log.
// Assign to `mockConsoleLog` so we can still inspect it when `console.log`
// is overridden by the test modules. The original function will be restored
// after this test finishes by `jest.restoreAllMocks()`.
@@ -2127,6 +2128,9 @@ describe('ReactFlight', () => {
transport = ReactNoopFlightServer.render({root: });
}).toErrorDev('err');
+ expect(mockConsoleLog).toHaveBeenCalledTimes(1);
+ expect(mockConsoleLog.mock.calls[0][0]).toBe('hi');
+ expect(mockConsoleLog.mock.calls[0][1].prop).toBe(123);
mockConsoleLog.mockClear();
// The error should not actually get logged because we're not awaiting the root
diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js
index 4f31ee906d7af..1d0c3581387da 100644
--- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js
@@ -17,6 +17,8 @@ describe('ReactDOMComponent', () => {
const ReactFeatureFlags = require('shared/ReactFeatureFlags');
let act;
+ let assertLog;
+ let Scheduler;
beforeEach(() => {
jest.resetModules();
@@ -24,7 +26,9 @@ describe('ReactDOMComponent', () => {
ReactDOM = require('react-dom');
ReactDOMClient = require('react-dom/client');
ReactDOMServer = require('react-dom/server');
+ Scheduler = require('scheduler');
act = require('internal-test-utils').act;
+ assertLog = require('internal-test-utils').assertLog;
});
afterEach(() => {
@@ -1611,7 +1615,6 @@ describe('ReactDOMComponent', () => {
});
it('should work error event on