FuncType - v1.21.0
    Preparing search index...

    Variable TestContext

    TestContext: {
        make: <R extends unknown = never>() => TestContext<R>;
        withClock: () => TestContext<TestClock>;
    }

    Creates a TestContext for testing IO effects with mocked services.

    Type Declaration

    • make: <R extends unknown = never>() => TestContext<R>

      Creates a new empty TestContext

    • withClock: () => TestContext<TestClock>

      Creates a TestContext with a TestClock already provided

    const ctx = TestContext.make()
    .withService(Logger, mockLogger)
    .withService(Database, mockDb)

    const result = await ctx.run(myProgram)