Beignet API reference
    Preparing search index...

    Interface UseCaseTester<Ctx>

    Small test harness for running use cases with typed inputs.

    interface UseCaseTester<Ctx> {
        ctx(): Promise<Ctx>;
        run<Input, Output>(
            useCase: { run(args: { ctx: Ctx; input: Input }): Promise<Output> },
            input: Input,
            options?: { ctx?: Ctx },
        ): Promise<Output>;
    }

    Type Parameters

    • Ctx
    Index

    Methods

    Methods

    • Create a fresh test context.

      Returns Promise<Ctx>

    • Run a use case with a typed input and either a fresh or explicit context.

      Type Parameters

      • Input
      • Output

      Parameters

      Returns Promise<Output>