UNPKG

@gentrace/core

Version:
22 lines (21 loc) 2.1 kB
import { TestCase, V1TestResultPost200Response } from "../models"; import { ResultContext } from "./context"; import { PipelineRun } from "./pipeline-run"; export declare function runTest(pipelineSlug: string, handler: (testCase: Omit<TestCase, "createdAt" | "updatedAt" | "archivedAt">) => Promise<[any, PipelineRun]>, contextOrCaseFilter?: ResultContext | ((testCase: Omit<TestCase, "createdAt" | "updatedAt" | "archivedAt">) => boolean), caseFilterOrUndefined?: (testCase: Omit<TestCase, "createdAt" | "updatedAt" | "archivedAt">) => boolean): Promise<V1TestResultPost200Response>; /** * Runs a test for a given pipeline slug and dataset ID. * @param {string} pipelineSlug: The slug of the pipeline * @param {string} datasetId: The ID of the dataset * @param {function} handler: The handler function that will be called for each test case * @param {ResultContext} [context]: An optional context object that will be passed to the Gentrace API * @param {function} [caseFilter]: An optional filter function that will be called for each test case */ export declare function runTestWithDataset(pipelineSlug: string, datasetId: string, handler: (testCase: Omit<TestCase, "createdAt" | "updatedAt" | "archivedAt">) => Promise<[any, PipelineRun]>, context?: ResultContext, caseFilter?: (testCase: Omit<TestCase, "createdAt" | "updatedAt" | "archivedAt">) => boolean): Promise<V1TestResultPost200Response>; /** * Runs a test for a given pipeline slug and dataset ID. * @param {string} pipelineSlug: The slug of the pipeline * @param {string} datasetId: The ID of the dataset * @param {function} handler: The handler function that will be called for each test case * @param {function} [caseFilter]: An optional filter function that will be called for each test case */ export declare function runTestWithDataset(pipelineSlug: string, datasetId: string, handler: (testCase: Omit<TestCase, "createdAt" | "updatedAt" | "archivedAt">) => Promise<[any, PipelineRun]>, caseFilter?: (testCase: Omit<TestCase, "createdAt" | "updatedAt" | "archivedAt">) => boolean): Promise<V1TestResultPost200Response>;