Hyperlinkv0.8.0-beta.28

Layer

Layer.PartialEffectfultypeeffect/Layer.ts:2190
PartialEffectful<A>

A utility type for creating partial mocks of services in testing.

When to use

Use to type partial test service implementations where only exercised effectful members are stubbed.

Details

This type makes Effect, Stream, and Channel values and functions returning them optional, while keeping non-effectful properties required. This allows you to provide only the methods you need to test while leaving others unimplemented.

testingmock
Source effect/Layer.ts:21908 lines
export type PartialEffectful<A extends object> = Types.Simplify<
  & {
    [K in keyof A as A[K] extends AnyEffectOrStream ? K : never]?: A[K]
  }
  & {
    [K in keyof A as A[K] extends AnyEffectOrStream ? never : K]: A[K]
  }
>
Referenced by 1 symbols