@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 52 lines 1.67 KB
Raw
1 import * as AWS from "@alchemy.run/aws";
2 import { expect } from "@alchemy.run/test";
3 import * as ag from "@distilled.cloud/aws/api-gateway";
4 import * as Provider from "alchemy/Provider";
5 import * as Effect from "effect/Effect";
6 import * as Test from "./Test.ts";
7
8 const { test } = Test.make({ providers: AWS.providers() });
9
10 test.provider.skipIf(!!process.env.FAST)(
11 "patch API Gateway account settings",
12 (stack) =>
13 Effect.gen(function* () {
14 // Account settings are a singleton patch resource — the leading destroy
15 // clears any prior partial deployment before capturing the baseline.
16 yield* stack.destroy();
17
18 const before = yield* ag.getAccount({});
19
20 yield* stack.deploy(
21 Effect.gen(function* () {
22 yield* AWS.ApiGateway.Account("AgAccount", {});
23 return undefined;
24 }),
25 );
26
27 const account = yield* ag.getAccount({});
28 expect(account).toBeDefined();
29
30 yield* stack.destroy();
31
32 const after = yield* ag.getAccount({});
33 expect(after.cloudwatchRoleArn).toEqual(before.cloudwatchRoleArn);
34 }),
35 { tags: ["provider:aws", "provider:aws:apigateway", "live"] },
36 );
37
38 test.provider.skipIf(!!process.env.FAST)(
39 "list returns the account settings singleton",
40 (stack) =>
41 Effect.gen(function* () {
42 const provider = yield* Provider.findProvider(AWS.ApiGateway.Account);
43 const all = yield* provider.list();
44
45 // Account settings are an account/region singleton — always exactly one.
46 expect(all.length).toBe(1);
47 expect(all[0]).toHaveProperty("managesCloudwatchRoleArn");
48
49 yield* stack.destroy();
50 }),
51 { tags: ["provider:aws", "provider:aws:apigateway", "live"] },
52 );