MCPcopy
hub / github.com/anomalyco/opencode / make

Function make

packages/core/test/lib/effect.ts:22–42  ·  view source on GitHub ↗
(testLayer: Layer.Layer<R, E>, liveLayer: Layer.Layer<R, E>)

Source from the content-addressed store, hash-verified

20 }).pipe(Effect.runPromise)
21
22const make = <R, E>(testLayer: Layer.Layer<R, E>, liveLayer: Layer.Layer<R, E>) => {
23 const effect = <A, E2>(name: string, value: Body<A, E2, R | Scope.Scope>, opts?: number | TestOptions) =>
24 test(name, () => run(value, testLayer), opts)
25
26 effect.only = <A, E2>(name: string, value: Body<A, E2, R | Scope.Scope>, opts?: number | TestOptions) =>
27 test.only(name, () => run(value, testLayer), opts)
28
29 effect.skip = <A, E2>(name: string, value: Body<A, E2, R | Scope.Scope>, opts?: number | TestOptions) =>
30 test.skip(name, () => run(value, testLayer), opts)
31
32 const live = <A, E2>(name: string, value: Body<A, E2, R | Scope.Scope>, opts?: number | TestOptions) =>
33 test(name, () => run(value, liveLayer), opts)
34
35 live.only = <A, E2>(name: string, value: Body<A, E2, R | Scope.Scope>, opts?: number | TestOptions) =>
36 test.only(name, () => run(value, liveLayer), opts)
37
38 live.skip = <A, E2>(name: string, value: Body<A, E2, R | Scope.Scope>, opts?: number | TestOptions) =>
39 test.skip(name, () => run(value, liveLayer), opts)
40
41 return { effect, live }
42}
43
44// Test environment with TestClock and TestConsole
45const testEnv = Layer.mergeAll(TestConsole.layer, TestClock.layer())

Callers 5

effect.tsFile · 0.70
testEffectFunction · 0.70
layer-node.test.tsFile · 0.50

Calls 1

runFunction · 0.70

Tested by 1