Skip to content

Commit

Permalink
Update testLogger.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth committed Jan 8, 2024
1 parent 8378ff1 commit a338333
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/test/utils/testLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ class TestLogger {
private shouldSuppressErrors = false;
private originalConsoleError = console.error;

private testErrorLogger = jest.fn((...params) => {
if (!this.shouldSuppressErrors) {
this.originalConsoleError.apply(console, params);
}
});

setup = () => {
beforeEach(() => {
console.error = jest.fn((...params) => {
if (!this.shouldSuppressErrors) {
this.originalConsoleError.apply(console, params);
}
});
console.error = this.testErrorLogger;
});

afterEach(() => {
Expand Down

0 comments on commit a338333

Please sign in to comment.