Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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");
});
afterEach(() => {
pino.mockClear();
});