Skip to content

Commit

Permalink
test: skip morgan logs during test
Browse files Browse the repository at this point in the history
  • Loading branch information
felixerdy committed Nov 13, 2024
1 parent d008ab2 commit c373f16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c373f16

Please sign in to comment.