KC's Workspace
    Preparing search index...

    User's custom test context.

    interface TestContext {
        annotate: {
            (
                message: string,
                type?: string,
                attachment?: TestAttachment,
            ): Promise<TestAnnotation>;
            (message: string, attachment?: TestAttachment): Promise<TestAnnotation>;
        };
        onTestFailed: (fn: OnTestFailedHandler, timeout?: number) => void;
        onTestFinished: (fn: OnTestFinishedHandler, timeout?: number) => void;
        signal: AbortSignal;
        skip: { (note?: string): never; (condition: boolean, note?: string): void };
        task: Readonly<Test>;
    }
    Index

    Properties

    annotate: {
        (
            message: string,
            type?: string,
            attachment?: TestAttachment,
        ): Promise<TestAnnotation>;
        (message: string, attachment?: TestAttachment): Promise<TestAnnotation>;
    }

    Add a test annotation that will be displayed by your reporter.

    onTestFailed: (fn: OnTestFailedHandler, timeout?: number) => void

    Extract hooks on test failed

    onTestFinished: (fn: OnTestFinishedHandler, timeout?: number) => void

    Extract hooks on test failed

    signal: AbortSignal

    An AbortSignal that will be aborted if the test times out or the test run was cancelled.

    skip: { (note?: string): never; (condition: boolean, note?: string): void }

    Mark tests as skipped. All execution after this call will be skipped. This function throws an error, so make sure you are not catching it accidentally.

    task: Readonly<Test>

    Metadata of the current test