arvo-event-handler
    Preparing search index...

    Type Alias ArvoTestStep

    ArvoTestStep: {
        input:
            | ((prev: ArvoEvent[] | null) => ArvoEvent)
            | ((prev: ArvoEvent[] | null) => Promise<ArvoEvent>);
    } & (
        | {
            expectedError?: never;
            expectedEvents?: | ((event: ArvoEvent[]) => boolean)
            | ((event: ArvoEvent[]) => Promise<boolean>);
        }
        | {
            expectedError?: | ((error: Error) => boolean)
            | ((error: Error) => Promise<boolean>);
            expectedEvents?: never;
        }
    )

    Defines a single test step in an event handler test sequence.

    Each step receives the output events from the previous step, generates a new input event, and validates either the output events or expected errors. Steps are executed sequentially, allowing you to test complex event-driven workflows.

    Type Declaration

    • input:
          | ((prev: ArvoEvent[] | null) => ArvoEvent)
          | ((prev: ArvoEvent[] | null) => Promise<ArvoEvent>)

      Generates the input event for this step based on previous step's output. Receives null on the first step or an array of ArvoEvents from the previous step.

    • {
          expectedError?: never;
          expectedEvents?:
              | ((event: ArvoEvent[]) => boolean)
              | ((event: ArvoEvent[]) => Promise<boolean>);
      }
      • OptionalexpectedError?: never
      • OptionalexpectedEvents?: ((event: ArvoEvent[]) => boolean) | ((event: ArvoEvent[]) => Promise<boolean>)

        Optional validator for output events when the handler executes successfully.

        Array of events emitted by the handler

        true if the events match expectations, false otherwise

    • {
          expectedError?:
              | ((error: Error) => boolean)
              | ((error: Error) => Promise<boolean>);
          expectedEvents?: never;
      }
      • OptionalexpectedError?: ((error: Error) => boolean) | ((error: Error) => Promise<boolean>)

        Optional validator for errors when the handler is expected to throw.

        The error thrown by the handler

        true if the error matches expectations, false otherwise

      • OptionalexpectedEvents?: never