Closed jenrrycordero2022 closed 2 years ago
I'm trying to build a logger module using Pino. Everything is good until I run our tests cases.
import pino from 'pino'; const logger = pino({ transport: { level: 'info', target: 'pino-pretty', options: { colorize: true, levelFirst: true, translateTime: 'SYS:yyyy-mm-dd HH:MM:ss', ignore: 'pid,hostname', }, }, }); try { // Some functionalities here... } catch (e) { logger.error(`mvpd auth - getPopularMvpds: ${e}`); }
This is the error when running: > yarn test
yarn test
ReferenceError: setImmediate is not defined
at ThreadStream.write (node_modules/thread-stream/index.js:245:7) at Pino.write (node_modules/pino/lib/proto.js:208:10) at Pino.error (node_modules/pino/lib/tools.js:60:21)
setImmediate is a global defined by Node.js. The fact that's not in your environment is the result of jest configuration.
Thanks Matteo!
Short Description:
I'm trying to build a logger module using Pino. Everything is good until I run our tests cases.
My code:
This is the error when running: >
yarn test
ReferenceError: setImmediate is not defined