testeranto
Version:
the AI powered BDD test framework for typescript projects
153 lines (142 loc) • 4.63 kB
text/typescript
import { ITestSpecification } from "../../CoreTypes";
import { I, O } from "./Tiposkripto.types";
import { ITestJob } from "..";
export const specification: ITestSpecification<I, O> = (
Suite,
Given,
When,
Then
) => {
return [
Suite.Default("Tiposkripto Core Functionality", {
// Basic initialization tests
initialization: Given.Default(
["Tiposkripto should initialize with default values"],
[],
[]
),
customInput: Given.WithCustomInput(
["Custom input test"],
[],
[]
),
resourceRequirements: Given.WithResourceRequirements(
["Resource requirements test"],
[],
[]
),
// Core functionality tests
specGeneration: Given.Default(
["Should generate specs from test specification"],
[],
[]
),
jobCreation: Given.Default(
["Should create test jobs from specs"],
[],
[]
),
artifactTracking: Given.Default(
["Should track artifacts"],
[],
[]
),
// Configuration tests
overridesConfiguration: Given.Default(
["Should properly configure all overrides"],
[],
[
Then.suitesOverridesConfigured(),
Then.givensOverridesConfigured(),
Then.whensOverridesConfigured(),
Then.thensOverridesConfigured(),
]
),
interfaceConfiguration: Given.WithCustomAdapter(
["Interface configuration test"],
[],
[],
{
assertThis: (x) => !!x,
beforeEach: async (s, i) => i(),
}
),
}),
Suite.ExtendedSuite("Tiposkripto Advanced Features", {
// Custom implementations
customImplementation: Given.WithCustomImplementation(
["Custom implementation test"],
[],
[]
),
customSpecification: Given.WithCustomSpecification(
["Custom specification test"],
[],
[]
),
// Dynamic modification tests
specModification: Given.Default(
["Should allow modifying specs"],
[])],
[]
),
jobModification: Given.Default(
["Should allow modifying jobs"],
[])],
[]
),
// Error handling
errorHandling: Given.Default(
["Should properly handle errors"],
[],
[]
),
// Full test run
fullTestRun: Given.Default(
["Should complete a full test run successfully"],
[],
[]
),
// runTimeTests behavior
runTimeTestsCount: Given.Default(
["Should correctly count the number of tests"],
[],
[]
),
runTimeTestsOnError: Given.Default(
["Should set runTimeTests to -1 on hard errors"],
[],
[]
),
// Specific test cases for runTimeTests behavior
runTimeTestsSingleSuiteFiveTests: Given.WithCustomInput(
["Given a config that has 1 suite containing 5 GivenWhenThens"],
[],
[],
{ testCount: 5 }
),
runTimeTestsSingleSuiteFiveTestsError: Given.WithCustomInput(
["Given a config that has 1 suite containing 5 GivenWhenThens"],
[],
[],
{ testCount: 5 }
),
runTimeTestsTwoSuitesThreeTestsEach: Given.WithCustomInput(
[
"Given a config that has 1 suite containing 3 GivenWhenThens and 1 suite containing 3 GivenWhenThens",
],
[],
[],
{ testCount: 6 }
),
runTimeTestsTwoSuitesThreeTestsEachError: Given.WithCustomInput(
[
"Given a config that has 1 suite containing 3 GivenWhenThens and 1 suite containing 3 GivenWhenThens",
],
[],
[],
{ testCount: 6 }
),
}),
];
};