@amiceli/vitest-cucumber
Version:
vitest tools to use Gherkin feature in unit tests
28 lines (27 loc) • 1.24 kB
TypeScript
import { type ArrowFunction, type CallExpression, Project, type SourceFile } from 'ts-morph';
export type AstOptions = {
specFilePath: string;
featureFilePath: string;
onDeleteAction?: 'comment' | 'delete';
formatCommand?: string;
};
export type VitestCallExpression = {
name: string;
callExpression: CallExpression;
};
export declare abstract class BaseAst {
protected readonly options: AstOptions;
protected readonly project: Project;
protected sourceFile: SourceFile;
protected readonly onDeleteAction: 'comment' | 'delete';
protected readonly formatCommand: string | undefined;
protected constructor(options: AstOptions);
protected resetProject(): void;
private checkSourceFile;
protected callExpressionMatchRegExp(parent: ArrowFunction, regex: RegExp): VitestCallExpression[];
protected getFirstArgumentAsString(callExpression: CallExpression): string | undefined;
protected removeChildFromParent(parent: ArrowFunction, child: CallExpression): void;
protected commentExpression(parent: ArrowFunction, child: CallExpression): void;
protected updateSyntaxListChild(arrow: ArrowFunction, newArgs: string[]): void;
protected get shouldComment(): boolean;
}