MCPcopy Create free account
hub / github.com/promptfoo/promptfoo / readJavascriptTestCases

Function readJavascriptTestCases

src/util/testCaseReader.ts:281–288  ·  view source on GitHub ↗
(
  pathWithoutFunction: string,
  maybeFunctionName: string | undefined,
  finalConfig: Record<string, any> | undefined,
)

Source from the content-addressed store, hash-verified

279}
280
281async function readJavascriptTestCases(
282 pathWithoutFunction: string,
283 maybeFunctionName: string | undefined,
284 finalConfig: Record<string, any> | undefined,
285): Promise<TestCase[]> {
286 const mod = await importModule(pathWithoutFunction, maybeFunctionName);
287 return typeof mod === 'function' ? await mod(finalConfig) : mod;
288}
289
290async function readPythonTestCases(
291 pathWithoutFunction: string,

Callers 1

Calls 1

importModuleFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…