Skip to content

Latest commit

 

History

History
85 lines (65 loc) · 2.09 KB

cucumber-node.api.md

File metadata and controls

85 lines (65 loc) · 2.09 KB

API Report File for "@cucumber/node"

Do not edit this file. It is a report generated by API Extractor.

import { Promisable } from 'type-fest';
import { Readable } from 'node:stream';
import { TestContext } from 'node:test';

// @public
export function After(fn: HookFunction): void;

// @public
export function After(options: HookOptions, fn: HookFunction): void;

// @public
export type AttachmentOptions = {
    mediaType: string;
    fileName?: string;
};

// @public
export function Before(fn: HookFunction): void;

// @public
export function Before(options: HookOptions, fn: HookFunction): void;

// @public
export class DataTable {
    constructor(cells: ReadonlyArray<ReadonlyArray<string>>);
    hashes(): ReadonlyArray<Record<string, string>>;
    list(): ReadonlyArray<string>;
    raw(): ReadonlyArray<ReadonlyArray<string>>;
    transpose(): DataTable;
}

// @public
export function Given(text: string, fn: StepFunction): void;

// @public
export type HookFunction = (context: TestCaseContext) => Promisable<void>;

// @public
export type HookOptions = {
    name?: string;
    tagFilter?: string;
};

// @public
export function ParameterType(options: ParameterTypeOptions): void;

// @public
export type ParameterTypeOptions = {
    name: string;
    regexp: RegExp | string | readonly RegExp[] | readonly string[];
    transformer?: (...match: string[]) => unknown;
    useForSnippets?: boolean;
    preferForRegexpMatch?: boolean;
};

// @public
export type StepFunction = (context: TestCaseContext, ...args: any) => Promisable<void>;

// @public
export type TestCaseContext = {
    assert: TestContext['assert'];
    mock: TestContext['mock'];
    skip(): void;
    todo(): void;
    attach(data: Readable | Buffer | string, options: AttachmentOptions): Promise<void>;
    log(text: string): Promise<void>;
    link(url: string, title?: string): Promise<void>;
    world: any;
};

// @public
export function Then(text: string, fn: StepFunction): void;

// @public
export function When(text: string, fn: StepFunction): void;

// (No @packageDocumentation comment for this package)