Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
jest.mock("pino");
const Pino = require("pino");
const childFakeLogger = { warn: jest.fn() };
const fakeLogger = {
child: jest.fn(() => childFakeLogger)
};
Pino.mockImplementation(() => fakeLogger);
const PinoLogger = require("../../../src/loggers/pino");
const ServiceBroker = require("../../../src/service-broker");
const LoggerFactory = require("../../../src/logger-factory");
const broker = new ServiceBroker({ logger: false });
describe("Test Pino logger class", () => {
describe("Test Constructor", () => {
it("should create with default options", () => {
const logger = new PinoLogger();
expect(logger.opts).toEqual({
pino: {