AWS SDK Vitest Mock - API Reference - v1.0.6
    Preparing search index...

    Interface AwsSdkMatchers<R>

    TypeScript interface for AWS SDK Vitest matchers. This interface is used to extend Vitest's assertion types.

    interface AwsSdkMatchers<R = unknown> {
        toHaveReceivedCommand<
            TInput extends object,
            TOutput extends MetadataBearer,
        >(
            command: CommandConstructor<TInput, TOutput>,
        ): R;
        toHaveReceivedCommandTimes<
            TInput extends object,
            TOutput extends MetadataBearer,
        >(
            command: CommandConstructor<TInput, TOutput>,
            times: number,
        ): R;
        toHaveReceivedCommandWith<
            TInput extends object,
            TOutput extends MetadataBearer,
        >(
            command: CommandConstructor<TInput, TOutput>,
            input: TInput,
        ): R;
        toHaveReceivedNthCommandWith<
            TInput extends object,
            TOutput extends MetadataBearer,
        >(
            n: number,
            command: CommandConstructor<TInput, TOutput>,
            input: TInput,
        ): R;
        toHaveReceivedNoOtherCommands<
            TInput extends object,
            TOutput extends MetadataBearer,
        >(
            expectedCommands?: CommandConstructor<TInput, TOutput>[],
        ): R;
    }

    Type Parameters

    • R = unknown
    Index

    Methods

    • Assert that a command was received at least once.

      Type Parameters

      • TInput extends object
      • TOutput extends MetadataBearer

      Parameters

      • command: CommandConstructor<TInput, TOutput>

        The command constructor to check for

      Returns R

    • Assert that a command was received exactly N times.

      Type Parameters

      • TInput extends object
      • TOutput extends MetadataBearer

      Parameters

      • command: CommandConstructor<TInput, TOutput>

        The command constructor to check for

      • times: number

        The exact number of times

      Returns R

    • Assert that a command was received with specific input.

      Type Parameters

      • TInput extends object
      • TOutput extends MetadataBearer

      Parameters

      • command: CommandConstructor<TInput, TOutput>

        The command constructor to check for

      • input: TInput

        The expected input parameters

      Returns R

    • Assert that the Nth command call matches expectations.

      Type Parameters

      • TInput extends object
      • TOutput extends MetadataBearer

      Parameters

      • n: number

        The call number (1-indexed)

      • command: CommandConstructor<TInput, TOutput>

        The command constructor to check for

      • input: TInput

        The expected input parameters

      Returns R

    • Assert that only expected commands were received.

      Type Parameters

      • TInput extends object
      • TOutput extends MetadataBearer

      Parameters

      • OptionalexpectedCommands: CommandConstructor<TInput, TOutput>[]

        Array of allowed command constructors

      Returns R