Showing the changes to apps/server/src/serverLifecycleEvents.test.ts (1 of 121 files). Show all
Unified · Split
| @@ -1,3 +1,4 @@ | |||
| 1 | import { EnvironmentId } from "@t3tools/contracts"; | ||
| 1 | import { assert, it } from "@effect/vitest"; | 2 | import { assert, it } from "@effect/vitest"; |
| 2 | import { assertTrue } from "@effect/vitest/utils"; | 3 | import { assertTrue } from "@effect/vitest/utils"; |
| 3 | import { Effect, Option } from "effect"; | 4 | import { Effect, Option } from "effect"; |
| @@ -9,12 +10,20 @@ it.effect( · 5 unmodified lines | |||
| 9 | () => | 10 | () => |
| 10 | Effect.gen(function* () { | 11 | Effect.gen(function* () { |
| 11 | const lifecycleEvents = yield* ServerLifecycleEvents; | 12 | const lifecycleEvents = yield* ServerLifecycleEvents; |
| 13 | const environment = { | ||
| 14 | environmentId: EnvironmentId.makeUnsafe("environment-test"), | ||
| 15 | label: "Test environment", | ||
| 16 | platform: { os: "darwin" as const, arch: "arm64" as const }, | ||
| 17 | serverVersion: "0.0.0-test", | ||
| 18 | capabilities: { repositoryIdentity: true }, | ||
| 19 | }; | ||
| 12 | 20 | ||
| 13 | const welcome = yield* lifecycleEvents | 21 | const welcome = yield* lifecycleEvents |
| 14 | .publish({ | 22 | .publish({ |
| 15 | version: 1, | 23 | version: 1, |
| 16 | type: "welcome", | 24 | type: "welcome", |
| 17 | payload: { | 25 | payload: { |
| 26 | environment, | ||
| 18 | cwd: "/tmp/project", | 27 | cwd: "/tmp/project", |
| 19 | projectName: "project", | 28 | projectName: "project", |
| 20 | }, | 29 | }, |
| @@ -29,6 +38,7 @@ it.effect( · 8 unmodified lines | |||
| 29 | type: "ready", | 38 | type: "ready", |
| 30 | payload: { | 39 | payload: { |
| 31 | at: new Date().toISOString(), | 40 | at: new Date().toISOString(), |
| 41 | environment, | ||
| 32 | }, | 42 | }, |
| 33 | }) | 43 | }) |
| 34 | .pipe(Effect.timeoutOption("50 millis")); | 44 | .pipe(Effect.timeoutOption("50 millis")); |