MCPcopy
hub / github.com/promptfoo/promptfoo / restoreEnvVar

Function restoreEnvVar

test/providers/openai-codex-sdk.test.ts:86–92  ·  view source on GitHub ↗
(name: 'OPENAI_API_KEY' | 'CODEX_API_KEY', value: string | undefined)

Source from the content-addressed store, hash-verified

84});
85
86function restoreEnvVar(name: 'OPENAI_API_KEY' | 'CODEX_API_KEY', value: string | undefined) {
87 if (value === undefined) {
88 mockProcessEnv({ [name]: undefined });
89 } else {
90 mockProcessEnv({ [name]: value });
91 }
92}
93
94describe('OpenAICodexSDKProvider', () => {
95 let statSyncSpy: MockInstance;

Callers 1

Calls 1

mockProcessEnvFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…