UNPKG

quickpickle

Version:

Plugin for Vitest to run tests written in Gherkin Syntax.

48 lines (47 loc) 2.39 kB
import { Plugin } from 'vite'; import { BeforeAll, Before, AfterAll, After, BeforeStep, AfterStep, applyHooks } from './hooks'; import { explodeTags } from './render'; import { DataTable } from './models/DataTable'; import { DocString } from './models/DocString'; import { normalizeTags, tagsMatch } from './tags'; export { setWorldConstructor, getWorldConstructor, QuickPickleWorld, QuickPickleWorldInterface, ScreenshotComparisonOptions, VisualConfigSetting, VisualWorld, VisualWorldInterface, VisualDiffResult, defaultScreenshotComparisonOptions, InfoConstructor, AriaRoleExtended, isAriaRoleExtended, } from './world'; export { DocString, DataTable }; export { explodeTags, tagsMatch, normalizeTags, applyHooks }; export { defineParameterType } from './steps'; export { BeforeAll, Before, AfterAll, After, BeforeStep, AfterStep }; export declare const Given: (expression: string | RegExp, f: (state: any, ...args: any[]) => any, priority?: number) => void; export declare const When: (expression: string | RegExp, f: (state: any, ...args: any[]) => any, priority?: number) => void; export declare const Then: (expression: string | RegExp, f: (state: any, ...args: any[]) => any, priority?: number) => void; export declare function formatStack(text: string, line: string): string; export declare const gherkinStep: (stepType: "Context" | "Action" | "Outcome", step: string, state: any, line: number, stepIdx: number, explodeIdx?: number, data?: any) => Promise<any>; export type QuickPickleConfigSetting<T = { [key: string]: any; }> = Partial<{ root?: string; stepTimeout: number; todoTags: string | string[]; skipTags: string | string[]; failTags: string | string[]; softFailTags: string | string[]; concurrentTags: string | string[]; sequentialTags: string | string[]; explodeTags: string | string[] | string[][]; worldConfig: Partial<T>; }>; export type QuickPickleConfig<T = { [key: string]: any; }> = { root: string; stepTimeout: number; todoTags: string[]; skipTags: string[]; failTags: string[]; softFailTags: string[]; concurrentTags: string[]; sequentialTags: string[]; explodeTags: string[][]; worldConfig: Partial<T>; }; export declare const defaultConfig: QuickPickleConfig; export declare const quickpickle: (conf?: Partial<QuickPickleConfigSetting>) => Plugin; export default quickpickle;