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
    • 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

      • useCase: { run(args: { ctx: Ctx; input: Input }): Promise<Output> }
      • input: Input
      • Optionaloptions: { ctx?: Ctx }

      Returns Promise<Output>