diff options
Diffstat (limited to 'src/routes.test.ts')
| -rw-r--r-- | src/routes.test.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/routes.test.ts b/src/routes.test.ts index 7f275b9..dc2b6a6 100644 --- a/src/routes.test.ts +++ b/src/routes.test.ts @@ -23,6 +23,28 @@ test("HOST_DIR must be readable and writable", () => { ).not.toThrowError(); }); +import { Writable } from "stream"; +import winston from "winston"; + +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 "./util/config"; import routes from "./routes"; import Metadata, { EnvConfig } from "./metadata"; |
