BUPKIS
    Preparing search index...

    Interface ExpectItExecutor<Subject>

    Interface for executor functions created by expect.it().

    ExpectItExecutor functions are the result of calling expect.it() with assertion parameters. They encapsulate the assertion logic and can be executed later within 'to satisfy' pattern matching contexts. These functions are marked with an internal symbol to distinguish them from regular functions during pattern validation.

    The executor accepts a subject value and performs the embedded assertion logic against it. The subject type is constrained by the Zod schema that represents the first part of the assertion definition, ensuring type safety during pattern matching.

    const isStringExecutor = expect.it('to be a string');
    // isStringExecutor is an ExpectItExecutor<z.ZodString>

    // Used within satisfy patterns
    expect({ name: 'Alice' }, 'to satisfy', {
    name: isStringExecutor, // Validates that name is a string
    });

    ExpectItFunction for the factory function that creates executors

    interface ExpectItExecutor<Subject extends z.ZodType> {
        "[kExpectIt]": true;
        (subject: z.core.output<Subject>): void;
    }

    Type Parameters

    • Subject extends z.ZodType

      The Zod schema type that constrains the subject parameter

    Index

    Properties

    Properties

    "[kExpectIt]": true