How to use the pino.mockClear function in pino

To help you get started, we’ve selected a few pino examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github moleculerjs / moleculer / test / unit / loggers / pino.spec.js View on Github external
it("should create a default logger with custom options", () => {
			Pino.mockClear();
			const logger = new PinoLogger({
				pino: {
					options: { a: 5 },
					destination: "/logs"
				},
			});

			logger.init(loggerFactory);

			expect(logger.pino).toBe(fakeLogger);

			expect(Pino).toHaveBeenCalledTimes(1);
			expect(Pino).toHaveBeenCalledWith({ a: 5 }, "/logs");
		});