From c373f162a05c7375b516a8ecb2dbfa9339fd3b3c Mon Sep 17 00:00:00 2001 From: Felix Erdmann Date: Wed, 13 Nov 2024 14:58:34 +0000 Subject: [PATCH] test: skip morgan logs during test --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index b35adda..14d011b 100644 --- a/src/index.js +++ b/src/index.js @@ -69,7 +69,7 @@ const errorHandler = function errorHandler (err, req, res, next) { }; const startServer = function startServer () { - app.use(morgan(':date[iso] :res[x-backend-server] :remote-addr :req[x-real-ip] :method :url :response-time[0] :status')); + app.use(morgan(':date[iso] :res[x-backend-server] :remote-addr :req[x-real-ip] :method :url :response-time[0] :status', { skip: (req, res) => process.env.NODE_ENV === 'test' })); app.use(responseTime()); app.use(preflight); app.use(preRequestValidator);