fix(test): avoid vitest mock type inference issues

This commit is contained in:
Peter Steinberger
2026-02-15 01:06:02 +01:00
parent b84cd25537
commit 07fbf46091
3 changed files with 27 additions and 9 deletions

View File

@@ -3,7 +3,15 @@ import os from "node:os";
import path from "node:path";
import { afterAll, afterEach, beforeAll, beforeEach, vi } from "vitest";
export function createNoopLogger() {
// Avoid exporting inferred vitest mock types (TS2742 under pnpm + d.ts emit).
export type NoopLogger = {
debug: ReturnType<typeof vi.fn>;
info: ReturnType<typeof vi.fn>;
warn: ReturnType<typeof vi.fn>;
error: ReturnType<typeof vi.fn>;
};
export function createNoopLogger(): NoopLogger {
return {
debug: vi.fn(),
info: vi.fn(),