testeranto
Version:
the AI powered BDD test framework for typescript projects
105 lines (97 loc) • 2.94 kB
text/typescript
import { ITestSpecification } from "../../CoreTypes";
import { I, O } from "./classBuilder.test.types";
import { implementation } from "./classBuilder.test.implementation";
export const specification: ITestSpecification<I, O> = (
Suite,
Given,
When,
Then
) => {
return [
Suite.Default("Basic ClassBuilder Functionality", {
// Basic initialization tests
initialization: Given.Default(
["ClassBuilder should initialize with default values"],
[],
[]
),
customInput: Given.WithCustomInput(
{ custom: "input" },
[],
[]
),
resourceRequirements: Given.WithResourceRequirements(
{ ports: [3000, 3001] },
[],
[]
),
// 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(),
]
),
}),
Suite.ExtendedSuite(
"Advanced ClassBuilder Functionality",
{
// Custom implementations
customImplementation: Given.WithCustomImplementation(
implementation,
[],
[]
),
customSpecification: Given.WithCustomSpecification(
specification,
[],
[]
),
// Dynamic modification tests
modifySpecs: Given.Default(
["Should allow modifying specs"],
[])],
[]
),
modifyJobs: Given.Default(
["Should allow modifying jobs"],
[])],
[]
),
// Error handling
errorHandling: Given.Default(
["Should properly handle errors"],
[],
[]
),
// Full test run
testRun: Given.Default(
["Should complete a full test run successfully"],
[],
[]
),
},
[]
),
];
};