From da1945e6163c4c5bd8a2fa121c8347ccea83ef0a Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Wed, 6 Apr 2022 02:04:06 +0000 Subject: Silence logs in unit tests --- src/routes.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/routes.test.ts') diff --git a/src/routes.test.ts b/src/routes.test.ts index 8560f56..1a6032a 100644 --- a/src/routes.test.ts +++ b/src/routes.test.ts @@ -12,6 +12,17 @@ import winston from "winston"; dotenv.config(); +jest.mock("./util/logger", () => ({ + __esModule: true, + default: () => ({ + format: winston.format.combine( + winston.format.splat(), + winston.format.simple() + ), + transports: [new winston.transports.Console({ silent: true })], + }), +})); + test("Environment variable HOST_DIR must be defined", () => { expect(process.env.HOST_DIR).not.toBeUndefined(); }); -- cgit