harmonyc
Version:
Harmony Code - model-driven BDD for Vitest
37 lines (36 loc) • 1.5 kB
TypeScript
import { CompilerOptions } from '../compiler/compile.ts';
import { Action, CodeGenerator, ErrorResponse, Feature, Phrase, PhraseMethod, Response, SaveToVariable, SetVariable, Test, TestGroup } from '../model/model.ts';
import { OutFile } from './outFile.ts';
export declare class VitestGenerator implements CodeGenerator {
private tf;
private sourceFileName;
private opts;
static error(message: string, stack: string): string;
framework: string;
phraseFns: Map<string, Phrase>;
currentFeatureName: string;
featureClassName: string;
phraseMethods: PhraseMethod[];
constructor(tf: OutFile, sourceFileName: string, opts: CompilerOptions);
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;
functionName(phrase: Phrase): string;
argPlaceholder(i: number): string;
}