@amiceli/vitest-cucumber
Version:
vitest tools to use Gherkin feature in unit tests
29 lines (28 loc) • 1.13 kB
TypeScript
import type { TestContext } from 'vitest';
import { type Step } from '../parser/models/step';
import type { ScenarioSteps } from './describe/types';
import type { DefineStepsHandler } from './types';
export type TagFilterItem = string | string[];
export type TagFilters = {
includeTags: TagFilterItem[];
excludeTags: TagFilterItem[];
};
export type VitestCucumberOptions = {
language?: string;
includeTags?: TagFilterItem[];
excludeTags?: TagFilterItem[];
predefinedSteps: ScenarioSteps[];
mappedExamples: {
[key: string]: unknown;
};
onStepError?: (args: {
error: Error;
ctx: TestContext;
step: Step;
}) => void;
};
export type RequiredVitestCucumberOptions = Required<VitestCucumberOptions>;
export declare const getVitestCucumberConfiguration: (options?: Omit<VitestCucumberOptions, "predefinedSteps" | "mappedExamples">) => RequiredVitestCucumberOptions;
export declare const setVitestCucumberConfiguration: (options: VitestCucumberOptions) => void;
export declare function resetDefinedSteps(): void;
export declare const defineSteps: DefineStepsHandler;