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 { NetworkAcl, Vpc } from "@alchemy.run/aws/EC2"; |
| 3 | import { expect } from "@alchemy.run/test"; |
| 4 | import * as Provider from "alchemy/Provider"; |
| 5 | import * as Effect from "effect/Effect"; |
| 6 | import { MinimumLogLevel } from "effect/References"; |
| 7 | import { assertNetworkAclGone, assertVpcGone } from "./Gone.ts"; |
| 8 | import * as Test from "./VpcTest.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 Network ACL", |
| 16 | (stack) => |
| 17 | Effect.gen(function* () { |
| 18 | yield* stack.destroy(); |
| 19 | |
| 20 | const { vpc, acl } = yield* stack.deploy( |
| 21 | Effect.gen(function* () { |
| 22 | const vpc = yield* Vpc("ListNaclVpc", { |
| 23 | cidrBlock: "10.0.0.0/16", |
| 24 | }); |
| 25 | const acl = yield* NetworkAcl("ListNacl", { |
| 26 | vpcId: vpc.vpcId, |
| 27 | }); |
| 28 | return { vpc, acl }; |
| 29 | }), |
| 30 | ); |
| 31 | |
| 32 | const provider = yield* Provider.findProvider(NetworkAcl); |
| 33 | const all = yield* provider.list(); |
| 34 | |
| 35 | expect(all.some((x) => x.networkAclId === acl.networkAclId)).toBe(true); |
| 36 | |
| 37 | yield* stack.destroy(); |
| 38 | |
| 39 | yield* assertNetworkAclGone(acl.networkAclId); |
| 40 | yield* assertVpcGone(vpc.vpcId); |
| 41 | }).pipe(logLevel), |
| 42 | { tags: ["provider:aws", "provider:aws:ec2", "live"], timeout: 180_000 }, |
| 43 | ); |