How to use the pino.mockReturnValue 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 dashukin / react-redux-template / src / common / utils / logger / __tests__ / logger.util.spec.js View on Github external
beforeEach(() => {
    mockPinoTrace = jest.fn();
    mockPinoDebug = jest.fn();
    mockPinoInfo = jest.fn();
    mockPinoWarn = jest.fn();
    mockPinoError = jest.fn();
    mockPinoFatal = jest.fn();
    mockPinoInstance = {};
    mockPinoInstance.trace = mockPinoTrace;
    mockPinoInstance.debug = mockPinoDebug;
    mockPinoInstance.info = mockPinoInfo;
    mockPinoInstance.warn = mockPinoWarn;
    mockPinoInstance.error = mockPinoError;
    mockPinoInstance.fatal = mockPinoFatal;
    pino.mockReturnValue(mockPinoInstance);
  });