MCPcopy
hub / github.com/promptfoo/promptfoo / mockConsole

Function mockConsole

test/util/utils.ts:81–86  ·  view source on GitHub ↗
(
  method: ConsoleMethod,
  implementation: (...args: unknown[]) => void = () => {},
)

Source from the content-addressed store, hash-verified

79export type ConsoleMethod = 'debug' | 'error' | 'info' | 'log' | 'warn';
80
81export function mockConsole(
82 method: ConsoleMethod,
83 implementation: (...args: unknown[]) => void = () => {},
84): MockInstance {
85 return vi.spyOn(console, method).mockImplementation(implementation);
86}
87
88function replaceProcessEnv(nextEnv: Record<string, string | undefined>): void {
89 for (const key of Object.keys(process.env)) {

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…