MCPcopy
hub / github.com/promptfoo/promptfoo / runEntrypoint

Function runEntrypoint

test/smoke/cli.test.ts:46–62  ·  view source on GitHub ↗

* Helper to run the CLI via entrypoint.js (the actual bin entry)

(
  args: string[],
  options: { cwd?: string; env?: NodeJS.ProcessEnv } = {},
)

Source from the content-addressed store, hash-verified

44 * Helper to run the CLI via entrypoint.js (the actual bin entry)
45 */
46function runEntrypoint(
47 args: string[],
48 options: { cwd?: string; env?: NodeJS.ProcessEnv } = {},
49): { stdout: string; stderr: string; exitCode: number } {
50 const result = spawnSync('node', [ENTRYPOINT_PATH, ...args], {
51 cwd: options.cwd || ROOT_DIR,
52 encoding: 'utf-8',
53 env: { ...process.env, ...options.env, NO_COLOR: '1' },
54 timeout: 30000,
55 });
56
57 return {
58 stdout: result.stdout || '',
59 stderr: result.stderr || '',
60 exitCode: result.status ?? 1,
61 };
62}
63
64function runEntrypointAsync(
65 args: string[],

Callers 1

cli.test.tsFile · 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…