harmonyc
Version:
Harmony Code - model-driven BDD for Vitest
32 lines (31 loc) • 1.28 kB
TypeScript
import { Action, CodeGenerator, ErrorResponse, Feature, Phrase, Response, SaveToVariable, SetVariable, Test, TestGroup } from '../model/model.ts';
import { OutFile } from './outFile.ts';
export declare class VitestGenerator implements CodeGenerator {
private tf;
private sf;
static error(message: string, stack: string): string;
framework: string;
phraseFns: Map<string, Phrase>;
currentFeatureName: string;
constructor(tf: OutFile, sf: OutFile);
feature(feature: Feature): void;
testGroup(g: TestGroup): void;
featureVars: Map<string, string>;
resultCount: number;
test(t: Test): void;
errorStep(action: Action, errorResponse: ErrorResponse): void;
extraArgs: string[];
step(action: Action, responses: Response[]): void;
private declareFeatureVariables;
phrase(p: Phrase): void;
setVariable(action: SetVariable): void;
saveToVariable(s: SaveToVariable, what?: string): void;
stringLiteral(text: string, { withVariables }: {
withVariables: boolean;
}): string;
codeLiteral(src: string): string;
private paramName;
stringParamDeclaration(index: number): string;
variantParamDeclaration(index: number): string;
}
export declare function functionName(phrase: Phrase): string;