MCPcopy
hub / github.com/promptfoo/promptfoo / setTestEnv

Function setTestEnv

test/matchers/moderation.test.ts:15–23  ·  view source on GitHub ↗
(overrides: Record<string, string | undefined> = {})

Source from the content-addressed store, hash-verified

13 let restoreProcessEnv = () => {};
14
15 function setTestEnv(overrides: Record<string, string | undefined> = {}) {
16 restoreProcessEnv();
17 restoreProcessEnv = mockProcessEnv({
18 OPENAI_API_KEY: undefined,
19 REPLICATE_API_KEY: undefined,
20 REPLICATE_API_TOKEN: undefined,
21 ...overrides,
22 });
23 }
24
25 beforeEach(() => {
26 setTestEnv();

Callers 1

moderation.test.tsFile · 0.85

Calls 2

mockProcessEnvFunction · 0.90
restoreProcessEnvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…