@fgaudo/effect-tea - v0.7.2
    Preparing search index...

    Variable rehearseConst

    rehearse: <
        State,
        Model,
        Message,
        Command = never,
        Event = never,
        R = never,
        A = unknown,
        E = never,
        RS = never,
        Flags = never,
    >(
        ...args: [
            program: Shape<
                State,
                Model,
                Message,
                Command,
                R,
                Event,
                unknown,
                Flags,
            >,
            scenario: (
                rehearsal: Rehearsal<State, Model, Message, Command, Event, R>,
            ) => Effect<A, E, RS>,
            ...(
                [Flags] extends [never]
                    ? [
                        options?: Readonly<
                            {
                                from?: Readonly<
                                    {
                                        commands?: (...)
                                        | (...);
                                        events?: (...) | (...);
                                        state: NoInfer<(...)>;
                                    },
                                >;
                            },
                        >,
                    ]
                    : [
                        options: RehearseOptions<
                            NoInfer<State>,
                            NoInfer<Command>,
                            NoInfer<Flags>,
                        >,
                    ]
            )[],
        ],
    ) => Effect<A, E, RS | Exclude<R, Scope>> = ...

    Rehearses program without a runtime, step by step, and returns what scenario returns. As in drive, the test acts through what the models show; unlike it, nothing runs by itself: each command waits until the test runs it, through the program's runCommand with the services provided, and each subscription message is one the test says was heard. So the test decides what happens while a command is under way, and when its answer arrives. Since the test decides when each message arrives, a message it sends from the current model is applied to the state that model shows, and a rejection is a control that does nothing: it fails the test, as an error update throws does, being a defect of the program. A command's or a subscription's message may no longer apply when it arrives: as when the program runs, it is ignored, and listed in ignored. A command still pending when scenario ends fails the test: its answer would still arrive.

    Type Declaration

      • <
            State,
            Model,
            Message,
            Command = never,
            Event = never,
            R = never,
            A = unknown,
            E = never,
            RS = never,
            Flags = never,
        >(
            ...args: [
                program: Shape<
                    State,
                    Model,
                    Message,
                    Command,
                    R,
                    Event,
                    unknown,
                    Flags,
                >,
                scenario: (
                    rehearsal: Rehearsal<State, Model, Message, Command, Event, R>,
                ) => Effect<A, E, RS>,
                ...(
                    [Flags] extends [never]
                        ? [
                            options?: Readonly<
                                {
                                    from?: Readonly<
                                        {
                                            commands?: (...)
                                            | (...);
                                            events?: (...) | (...);
                                            state: NoInfer<(...)>;
                                        },
                                    >;
                                },
                            >,
                        ]
                        : [
                            options: RehearseOptions<
                                NoInfer<State>,
                                NoInfer<Command>,
                                NoInfer<Flags>,
                            >,
                        ]
                )[],
            ],
        ): Effect<A, E, RS | Exclude<R, Scope>>
      • Type Parameters

        • State
        • Model
        • Message
        • Command = never
        • Event = never
        • R = never
        • A = unknown
        • E = never
        • RS = never
        • Flags = never

        Parameters

        • ...args: [
              program: Shape<State, Model, Message, Command, R, Event, unknown, Flags>,
              scenario: (
                  rehearsal: Rehearsal<State, Model, Message, Command, Event, R>,
              ) => Effect<A, E, RS>,
              ...(
                  [Flags] extends [never]
                      ? [
                          options?: Readonly<
                              {
                                  from?: Readonly<
                                      {
                                          commands?: (...)
                                          | (...);
                                          events?: (...) | (...);
                                          state: NoInfer<(...)>;
                                      },
                                  >;
                              },
                          >,
                      ]
                      : [
                          options: RehearseOptions<
                              NoInfer<State>,
                              NoInfer<Command>,
                              NoInfer<Flags>,
                          >,
                      ]
              )[],
          ]

        Returns Effect<A, E, RS | Exclude<R, Scope>>