Skip to content

Commit

Permalink
chore: hide console.error output
Browse files Browse the repository at this point in the history
  • Loading branch information
ymqy committed Feb 10, 2023
1 parent d8d6164 commit 8c9de68
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Expand Up @@ -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};
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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};
Expand Down
Expand Up @@ -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();
Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -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');
Expand Down
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Expand Up @@ -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);
Expand Down

0 comments on commit 8c9de68

Please sign in to comment.