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
| 1 | import * as AWS from "@alchemy.run/aws"; |
| 2 | import { EIP } from "@alchemy.run/aws/EC2"; |
| 3 | import { expect } from "@alchemy.run/test"; |
| 4 | import * as Test from "@alchemy.run/test/Alchemy"; |
| 5 | import * as Provider from "alchemy/Provider"; |
| 6 | import * as Effect from "effect/Effect"; |
| 7 | import { MinimumLogLevel } from "effect/References"; |
| 8 | import { assertEipGone } from "./Gone.ts"; |
| 9 | |
| 10 | const { test } = Test.make({ providers: AWS.providers() }); |
| 11 | |
| 12 | const logLevel = Effect.provideService(MinimumLogLevel, process.env.DEBUG ? "Debug" : "Info"); |
| 13 | |
| 14 | test.provider( |
| 15 | "list enumerates the deployed EIP", |
| 16 | (stack) => |
| 17 | Effect.gen(function* () { |
| 18 | yield* stack.destroy(); |
| 19 | |
| 20 | const deployed = yield* stack.deploy( |
| 21 | Effect.gen(function* () { |
| 22 | return yield* EIP("ListEIP", {}); |
| 23 | }), |
| 24 | ); |
| 25 | |
| 26 | const provider = yield* Provider.findProvider(EIP); |
| 27 | const all = yield* provider.list(); |
| 28 | |
| 29 | expect(all.some((x) => x.allocationId === deployed.allocationId)).toBe(true); |
| 30 | |
| 31 | yield* stack.destroy(); |
| 32 | |
| 33 | yield* assertEipGone(deployed.allocationId); |
| 34 | }).pipe(logLevel), |
| 35 | { tags: ["provider:aws", "provider:aws:ec2", "live"] }, |
| 36 | ); |