MCPcopy
hub / github.com/promptfoo/promptfoo / mockReadFileSync

Function mockReadFileSync

test/redteam/commands/generate.test.ts:71–75  ·  view source on GitHub ↗
(content: unknown)

Source from the content-addressed store, hash-verified

69}
70
71function mockReadFileSync(content: unknown) {
72 vi.mocked(fs.readFileSync).mockImplementation(() =>
73 typeof content === 'string' ? content : JSON.stringify(content),
74 );
75}
76
77const fsMocks = vi.hoisted(() => ({
78 readFileSync: vi.fn(),

Callers 5

http-tls.test.tsFile · 0.85
generate.test.tsFile · 0.85
llm-rubric.test.tsFile · 0.85
implementationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…