Skip to content

Commit

Permalink
Merge pull request #70 from wix-incubator/mock-file-logs
Browse files Browse the repository at this point in the history
fix: mock logs to file function
  • Loading branch information
asafkorem authored Jan 27, 2025
2 parents 2a80f28 + 07d8841 commit bb60e69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test-utils/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const originalConsole = { ...console };
import logger from "@/utils/logger";

beforeAll(() => {
console.log = jest.fn();
console.info = jest.fn();
Expand All @@ -7,6 +9,7 @@ beforeAll(() => {
console.debug = jest.fn();
process.stdout.write = jest.fn();
process.stderr.write = jest.fn();
jest.spyOn(logger, "writeLogsToFile").mockImplementation(() => {});
});

afterAll(() => {
Expand Down

0 comments on commit bb60e69

Please sign in to comment.