From 3e2af75628f6ff8cfa79cf0f5a22c1102e9c30e5 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Wed, 6 Apr 2022 00:29:31 +0000 Subject: Remove unused code for testing logs --- .yarnrc.yml | 1 + src/routes.test.ts | 23 ----------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index 09db4b9..c6087b4 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,4 +1,5 @@ enableTelemetry: false +pnpEnableEsmLoader: false logFilters: - code: YN0062 diff --git a/src/routes.test.ts b/src/routes.test.ts index 2633308..8560f56 100644 --- a/src/routes.test.ts +++ b/src/routes.test.ts @@ -8,7 +8,6 @@ import express from "express"; import dotenv from "dotenv"; import fs from "fs"; import path from "path"; -import { Writable } from "stream"; import winston from "winston"; dotenv.config(); @@ -25,28 +24,6 @@ test("HOST_DIR must be readable and writable", () => { ).not.toThrowError(); }); -let output = ""; - -jest.mock("./util/logger", () => { - const stream = new Writable(); - stream._write = (chunk, _encoding, next) => { - output = output += chunk.toString(); - next(); - }; - const streamTransport = new winston.transports.Stream({ stream }); - - return { - __esModule: true, - default: () => ({ - format: winston.format.combine( - winston.format.splat(), - winston.format.simple() - ), - transports: [streamTransport], - }), - }; -}); - import { configOrError, persistTemplate } from "./config"; import loggerConfig from "./util/logger"; import routes from "./routes"; -- cgit