Evalkeeper
    Preparing search index...

    Type Alias ContractMatchers

    The matchers the contracts in @crowandraven/evalkeeper/testing use, a small part of Vitest's and Jest's expect. Any expect with these works: Vitest's, the expect package, or assertExpect.

    type ContractMatchers = {
        rejects: {
            toBeInstanceOf(
                expected: new (...args: never[]) => unknown,
            ): Promise<void>;
            toThrow(expected: string): Promise<void>;
        };
        toBe(expected: unknown): void;
        toBeGreaterThanOrEqual(expected: number): void;
        toBeLessThanOrEqual(expected: number): void;
        toBeNull(): void;
        toEqual(expected: unknown): void;
        toHaveLength(length: number): void;
        toMatchObject(expected: object): void;
    }
    Index
    rejects: {
        toBeInstanceOf(
            expected: new (...args: never[]) => unknown,
        ): Promise<void>;
        toThrow(expected: string): Promise<void>;
    }

    For a promise: passes when it fails as described.

    Type Declaration

    • toBeInstanceOf: function
      • Passes when the promise fails with an instance of this class.

        Parameters

        • expected: new (...args: never[]) => unknown

        Returns Promise<void>

    • toThrow: function
      • Passes when the promise fails with an error whose message has this text.

        Parameters

        • expected: string

        Returns Promise<void>

    • Passes when the value is a number at least this.

      Parameters

      • expected: number

      Returns void

    • Passes when the value is a number at most this.

      Parameters

      • expected: number

      Returns void

    • Passes when the value has the same content, ignoring undefined keys.

      Parameters

      • expected: unknown

      Returns void

    • Passes when the value has at least these keys with these values.

      Parameters

      • expected: object

      Returns void