MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / mockDynamicModule

Function mockDynamicModule

test/evaluatorHelpers.test.ts:28–31  ·  view source on GitHub ↗
(filePath: string, moduleExport: any)

Source from the content-addressed store, hash-verified

26 const mockPathResolve = vi.fn((...paths: string[]) => actualPathResolve(...paths));
27 const dynamicModuleMocks = new Map<string, any>();
28 const mockDynamicModule = (filePath: string, moduleExport: any) => {
29 const resolvedPath = actualPathResolve(filePath);
30 dynamicModuleMocks.set(resolvedPath, moduleExport);
31 };
32 const fsMocks = {
33 readFileSync: vi.fn(),
34 writeFileSync: vi.fn(),

Callers 1

Calls 1

setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…