The best way to control Claude Code, Codex and more from any computer or phone

main
ts 33 lines 1.21 KB
Raw
1 import * as GitHub from "@alchemy.run/github";
2 import { expect } from "@alchemy.run/test";
3 import * as Test from "@alchemy.run/test/Alchemy";
4 import * as Provider from "alchemy/Provider";
5 import * as Effect from "effect/Effect";
6 import { MinimumLogLevel } from "effect/References";
7
8 const { test } = Test.make({ providers: GitHub.providers() });
9
10 const logLevel = Effect.provideService(MinimumLogLevel, process.env.DEBUG ? "Debug" : "Info");
11
12 // A GitHub Comment is keyed entirely by its parent {owner, repository,
13 // issueNumber} plus a server-assigned commentId. GitHub only enumerates
14 // comments *within* a specific issue/PR — there is no account- or repo-wide
15 // API to list every comment without first knowing the issue/PR. So the
16 // provider is non-listable and `list()` returns `[]`.
17 test.provider(
18 "list returns [] for the non-listable Comment provider",
19 (stack) =>
20 Effect.gen(function* () {
21 yield* stack.destroy();
22
23 const provider = yield* Provider.findProvider(GitHub.Comment);
24 const all = yield* provider.list();
25 expect(all).toEqual([]);
26
27 yield* stack.destroy();
28 }).pipe(logLevel),
29 {
30 tags: ["provider:github", "provider:github:comment", "live"],
31 timeout: 120_000,
32 },
33 );