UNPKG

@alexaegis/logging

Version:

Minimal logging tools

34 lines (33 loc) 949 B
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); //#region src/mocks.ts /** * The vi object is passed because if there's a version mismatch in a pnpm * workspace between this package and its consumer, a different vitest will * initialize these mock functions and you wouldn't be able to reset/clear * mocks * * It will return a logger wrapped in an object, under two keys: * one with the mock type to let you use them as mocks, and one with the real * Logger type so you can pass it around. Both are the same object instance. */ var createMockLogger = (vi) => { const mockLogger = { silly: vi.fn(), trace: vi.fn(), debug: vi.fn(), log: vi.fn(), info: vi.fn(), warn: vi.fn(), fatal: vi.fn(), error: vi.fn(), attachTransport: vi.fn(), getSubLogger: vi.fn() }; return { logger: mockLogger, mockLogger }; }; //#endregion exports.createMockLogger = createMockLogger; //# sourceMappingURL=mocks.cjs.map