UNPKG

@soos-io/api-client

Version:

This is the SOOS API Client for registered clients leveraging the various integrations to the SOOS platform. Register for a free trial today at https://app.soos.io/register

35 lines (34 loc) 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const enums_1 = require("../enums"); const SOOSLogger_1 = tslib_1.__importDefault(require("./SOOSLogger")); const getSut = () => { return new SOOSLogger_1.default(); }; describe("SOOSLogger", () => { test("will log separator in DEBUG", () => { const consoleSpy = jest.spyOn(console, "log").mockImplementation(); const logger = getSut(); logger.setMinLogLevel(enums_1.LogLevel.DEBUG); logger.logLineSeparator(); expect(consoleSpy).toHaveBeenCalledWith("--------------------------------------------------------------------------------\n"); consoleSpy.mockRestore(); }); test("will log separator in INFO", () => { const consoleSpy = jest.spyOn(console, "log").mockImplementation(); const logger = getSut(); logger.setMinLogLevel(enums_1.LogLevel.INFO); logger.logLineSeparator(); expect(consoleSpy).toHaveBeenCalledWith("--------------------------------------------------------------------------------\n"); consoleSpy.mockRestore(); }); test("will NOT log separator in WARN", () => { const consoleSpy = jest.spyOn(console, "log").mockImplementation(); const logger = getSut(); logger.setMinLogLevel(enums_1.LogLevel.WARN); logger.logLineSeparator(); expect(consoleSpy).not.toHaveBeenCalledWith("--------------------------------------------------------------------------------\n"); consoleSpy.mockRestore(); }); });