MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / stubWorkOS

Function stubWorkOS

apps/cloud/src/auth/api-keys.node.test.ts:7–16  ·  view source on GitHub ↗
(overrides: Partial<WorkOSClientService>)

Source from the content-addressed store, hash-verified

5import { WorkOSClient, type WorkOSClientService } from "./workos";
6
7const stubWorkOS = (overrides: Partial<WorkOSClientService>) =>
8 Layer.succeed(
9 WorkOSClient,
10 new Proxy({} as WorkOSClientService, {
11 get: (_target, prop) => {
12 if (prop in overrides) return overrides[prop as keyof WorkOSClientService];
13 return () => Effect.die(`unexpected WorkOSClient.${String(prop)} call`);
14 },
15 }),
16 );
17
18const validate = (response: unknown) =>
19 Effect.gen(function* () {

Callers 2

validateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected