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

Function instance

packages/opencode/test/lib/effect.ts:86–98  ·  view source on GitHub ↗
(
    name: string,
    value: Body<A, E2, R | InstanceStore.Service | TestInstance | Scope.Scope>,
    options?: InstanceOptions<E3, R | Scope.Scope> | number | TestOptions,
    opts?: number | TestOptions,
  )

Source from the content-addressed store, hash-verified

84 test.skip(name, () => run(value, liveLayer), opts)
85
86 const instance = <A, E2, E3 = never>(
87 name: string,
88 value: Body<A, E2, R | InstanceStore.Service | TestInstance | Scope.Scope>,
89 options?: InstanceOptions<E3, R | Scope.Scope> | number | TestOptions,
90 opts?: number | TestOptions,
91 ) => {
92 const args = instanceArgs(options, opts)
93 return test(
94 name,
95 () => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer),
96 args.testOptions,
97 )
98 }
99
100 instance.only = <A, E2, E3 = never>(
101 name: string,

Callers

nothing calls this directly

Calls 5

withTmpdirInstanceFunction · 0.90
instanceArgsFunction · 0.85
testFunction · 0.85
runFunction · 0.70
bodyFunction · 0.70

Tested by

no test coverage detected