Skip to main content
Version: 4.7.34

Test cases - Create multiple

Create multiple test cases with createTestCases().

Example

typescript
const creationCount = await createTestCases({
pipelineSlug: 'example-pipeline',
datasetId: '550e8400-e29b-41d4-a716-446655440000',
testCases: [
{
name: `TC 1`,
inputs: { a: 1, b: 2 },
expectedOutputs: { c: 3 },
},
],
});
 
console.log('Created test case count: ', creationCount);

Arguments

payload: CreateMultipleTestCase

Note: Either datasetId or pipelineSlug can be specified in the payload. If both are provided, datasetId will be prioritized.

Types

🛠️ CreateMultipleTestCase

This type defines the structure for creating multiple test cases.

pipelineSlug: string
testCases: CreateMultipleTestCasesTestCasesInner[]
🛠️ CreateMultipleTestCasesTestCasesInner

This type defines the structure for creating a single test case.

name?: string

inputs?: object

expectedOutputs?: object

Return value

creationCount: number

The number of test cases created as a number.