Files
klz-cables.com/.pnpm-store/v10/files/24/3b5127ea54ac1ae9d3d1c837ffeeeaff7447df06092970d83392cc7e42a27cd99f35b93e975d7d935ba659caca5defce6b01c8f533f021011d0620df901008
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

28 lines
1.1 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("../logger");
describe('logger', function () {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var infoSpy;
beforeEach(function () {
infoSpy = jest.spyOn(console, 'info').mockImplementation(function () {
// do nothing
});
});
afterEach(function () {
infoSpy.mockRestore();
});
it('should call console.info when logger enabled', function () {
var id = Math.random().toString();
var logger = new logger_1.Logger({ id: id, enabled: true });
logger.info('testing');
expect(infoSpy).toHaveBeenLastCalledWith(id, expect.stringMatching(/\d+ms/), 'testing');
});
it("shouldn't call console.info when logger disabled", function () {
var id = Math.random().toString();
var logger = new logger_1.Logger({ id: id, enabled: false });
logger.info('testing');
expect(infoSpy).not.toHaveBeenCalled();
});
});
//# sourceMappingURL=logger.js.map