Skip to content

Commit 8c9de68

Browse files
committed
chore: hide console.error output
1 parent d8d6164 commit 8c9de68

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ describe('Timeline profiler', () => {
744744
});
745745

746746
it('should mark sync render that throws', async () => {
747-
jest.spyOn(console, 'error');
747+
jest.spyOn(console, 'error').mockImplementation(() => {});
748748

749749
class ErrorBoundary extends React.Component {
750750
state = {error: null};
@@ -806,7 +806,7 @@ describe('Timeline profiler', () => {
806806
});
807807

808808
it('should mark concurrent render that throws', async () => {
809-
jest.spyOn(console, 'error');
809+
jest.spyOn(console, 'error').mockImplementation(() => {});
810810

811811
class ErrorBoundary extends React.Component {
812812
state = {error: null};
@@ -1997,7 +1997,7 @@ describe('Timeline profiler', () => {
19971997
});
19981998

19991999
it('should mark sync render that throws', async () => {
2000-
jest.spyOn(console, 'error');
2000+
jest.spyOn(console, 'error').mockImplementation(() => {});
20012001

20022002
class ErrorBoundary extends React.Component {
20032003
state = {error: null};
@@ -2092,7 +2092,7 @@ describe('Timeline profiler', () => {
20922092
});
20932093

20942094
it('should mark concurrent render that throws', async () => {
2095-
jest.spyOn(console, 'error');
2095+
jest.spyOn(console, 'error').mockImplementation(() => {});
20962096

20972097
class ErrorBoundary extends React.Component {
20982098
state = {error: null};

packages/react-devtools-shared/src/__tests__/bridge-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Bridge', () => {
3838
expect(wall.send).toHaveBeenCalledWith('shutdown');
3939

4040
// Verify that the Bridge doesn't send messages after shutdown.
41-
jest.spyOn(console, 'warn');
41+
jest.spyOn(console, 'warn').mockImplementation(() => {});
4242
wall.send.mockClear();
4343
bridge.send('should not send');
4444
jest.runAllTimers();

packages/react-devtools-shared/src/__tests__/inspectedElement-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ describe('InspectedElement', () => {
21212121
});
21222122

21232123
it('should gracefully surface backend errors on the frontend rather than timing out', async () => {
2124-
jest.spyOn(console, 'error');
2124+
jest.spyOn(console, 'error').mockImplementation(() => {});
21252125

21262126
let shouldThrow = false;
21272127

@@ -2738,7 +2738,7 @@ describe('InspectedElement', () => {
27382738

27392739
it('inspecting nested renderers should not throw', async () => {
27402740
// Ignoring react art warnings
2741-
jest.spyOn(console, 'error');
2741+
jest.spyOn(console, 'error').mockImplementation(() => {});
27422742
const ReactArt = require('react-art');
27432743
const ArtSVGMode = require('art/modes/svg');
27442744
const ARTCurrentMode = require('art/modes/current');

packages/react-devtools-shared/src/__tests__/preprocessData-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ describe('Timeline profiler', () => {
11351135
);
11361136
const invalidUserTimingData = createUserTimingData(invalidMarks);
11371137

1138-
const error = jest.spyOn(console, 'error');
1138+
const error = jest.spyOn(console, 'error').mockImplementation(() => {});
11391139
preprocessData([
11401140
...createBoilerplateEntries(),
11411141
...invalidUserTimingData,
@@ -1153,7 +1153,7 @@ describe('Timeline profiler', () => {
11531153
);
11541154
const invalidUserTimingData = createUserTimingData(invalidMarks);
11551155

1156-
const error = jest.spyOn(console, 'error');
1156+
const error = jest.spyOn(console, 'error').mockImplementation(() => {});
11571157
preprocessData([
11581158
...createBoilerplateEntries(),
11591159
...invalidUserTimingData,

packages/react-devtools-shared/src/__tests__/profilerStore-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('ProfilerStore', () => {
7373
const fauxProfilingData = {
7474
dataForRoots: new Map(),
7575
};
76-
jest.spyOn(console, 'warn');
76+
jest.spyOn(console, 'warn').mockImplementation(() => {});
7777
store.profilerStore.profilingData = fauxProfilingData;
7878
expect(store.profilerStore.profilingData).not.toBe(fauxProfilingData);
7979
expect(console.warn).toHaveBeenCalledTimes(1);

0 commit comments

Comments
 (0)