History

Prepare datamodel for multi-environment (#1765)

Julius Marminge committed 7 months ago

Commit b96308f1 parent 72b7f90121 files · +10206 −4969Browse files

Showing the changes to apps/server/src/serverLifecycleEvents.test.ts (1 of 121 files). Show all

Unified · Split

apps/server/src/serverLifecycleEvents.test.ts+10−0
@@ -1,3 +1,4 @@
1import { EnvironmentId } from "@t3tools/contracts";
1import { assert, it } from "@effect/vitest";2import { assert, it } from "@effect/vitest";
2import { assertTrue } from "@effect/vitest/utils";3import { assertTrue } from "@effect/vitest/utils";
3import { Effect, Option } from "effect";4import { 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* lifecycleEvents21 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"));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t