diff --git a/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js b/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js index fb7c83bb92780..0be6e57f43b9b 100644 --- a/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js +++ b/packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js @@ -744,7 +744,7 @@ describe('Timeline profiler', () => { }); it('should mark sync render that throws', async () => { - jest.spyOn(console, 'error'); + jest.spyOn(console, 'error').mockImplementation(() => {}); class ErrorBoundary extends React.Component { state = {error: null}; @@ -806,7 +806,7 @@ describe('Timeline profiler', () => { }); it('should mark concurrent render that throws', async () => { - jest.spyOn(console, 'error'); + jest.spyOn(console, 'error').mockImplementation(() => {}); class ErrorBoundary extends React.Component { state = {error: null}; @@ -1997,7 +1997,7 @@ describe('Timeline profiler', () => { }); it('should mark sync render that throws', async () => { - jest.spyOn(console, 'error'); + jest.spyOn(console, 'error').mockImplementation(() => {}); class ErrorBoundary extends React.Component { state = {error: null}; @@ -2092,7 +2092,7 @@ describe('Timeline profiler', () => { }); it('should mark concurrent render that throws', async () => { - jest.spyOn(console, 'error'); + jest.spyOn(console, 'error').mockImplementation(() => {}); class ErrorBoundary extends React.Component { state = {error: null}; diff --git a/packages/react-devtools-shared/src/__tests__/bridge-test.js b/packages/react-devtools-shared/src/__tests__/bridge-test.js index 36c4de394af3e..d38c0fe66a8b9 100644 --- a/packages/react-devtools-shared/src/__tests__/bridge-test.js +++ b/packages/react-devtools-shared/src/__tests__/bridge-test.js @@ -38,7 +38,7 @@ describe('Bridge', () => { expect(wall.send).toHaveBeenCalledWith('shutdown'); // Verify that the Bridge doesn't send messages after shutdown. - jest.spyOn(console, 'warn'); + jest.spyOn(console, 'warn').mockImplementation(() => {}); wall.send.mockClear(); bridge.send('should not send'); jest.runAllTimers(); diff --git a/packages/react-devtools-shared/src/__tests__/inspectedElement-test.js b/packages/react-devtools-shared/src/__tests__/inspectedElement-test.js index e19236fe68148..56e80065b7617 100644 --- a/packages/react-devtools-shared/src/__tests__/inspectedElement-test.js +++ b/packages/react-devtools-shared/src/__tests__/inspectedElement-test.js @@ -2121,7 +2121,7 @@ describe('InspectedElement', () => { }); it('should gracefully surface backend errors on the frontend rather than timing out', async () => { - jest.spyOn(console, 'error'); + jest.spyOn(console, 'error').mockImplementation(() => {}); let shouldThrow = false; @@ -2738,7 +2738,7 @@ describe('InspectedElement', () => { it('inspecting nested renderers should not throw', async () => { // Ignoring react art warnings - jest.spyOn(console, 'error'); + jest.spyOn(console, 'error').mockImplementation(() => {}); const ReactArt = require('react-art'); const ArtSVGMode = require('art/modes/svg'); const ARTCurrentMode = require('art/modes/current'); diff --git a/packages/react-devtools-shared/src/__tests__/preprocessData-test.js b/packages/react-devtools-shared/src/__tests__/preprocessData-test.js index 0500ac9aecab9..fe4f60c44191f 100644 --- a/packages/react-devtools-shared/src/__tests__/preprocessData-test.js +++ b/packages/react-devtools-shared/src/__tests__/preprocessData-test.js @@ -1135,7 +1135,7 @@ describe('Timeline profiler', () => { ); const invalidUserTimingData = createUserTimingData(invalidMarks); - const error = jest.spyOn(console, 'error'); + const error = jest.spyOn(console, 'error').mockImplementation(() => {}); preprocessData([ ...createBoilerplateEntries(), ...invalidUserTimingData, @@ -1153,7 +1153,7 @@ describe('Timeline profiler', () => { ); const invalidUserTimingData = createUserTimingData(invalidMarks); - const error = jest.spyOn(console, 'error'); + const error = jest.spyOn(console, 'error').mockImplementation(() => {}); preprocessData([ ...createBoilerplateEntries(), ...invalidUserTimingData, diff --git a/packages/react-devtools-shared/src/__tests__/profilerStore-test.js b/packages/react-devtools-shared/src/__tests__/profilerStore-test.js index 2a723f6861bb1..fcc4de34eafc7 100644 --- a/packages/react-devtools-shared/src/__tests__/profilerStore-test.js +++ b/packages/react-devtools-shared/src/__tests__/profilerStore-test.js @@ -73,7 +73,7 @@ describe('ProfilerStore', () => { const fauxProfilingData = { dataForRoots: new Map(), }; - jest.spyOn(console, 'warn'); + jest.spyOn(console, 'warn').mockImplementation(() => {}); store.profilerStore.profilingData = fauxProfilingData; expect(store.profilerStore.profilingData).not.toBe(fauxProfilingData); expect(console.warn).toHaveBeenCalledTimes(1);