mirror of
https://github.com/hanzoai/dev-desktop.git
synced 2026-11-20 22:31:20 +00:00
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import * as NodeServices from "@effect/platform-node/NodeServices";
|
|
import { assert, it } from "@effect/vitest";
|
|
import * as Effect from "effect/Effect";
|
|
import * as FileSystem from "effect/FileSystem";
|
|
import * as Path from "effect/Path";
|
|
|
|
import packageJson from "../../package.json" with { type: "json" };
|
|
import {
|
|
makePersistedServerRuntimeState,
|
|
persistServerRuntimeState,
|
|
} from "../serverRuntimeState.ts";
|
|
import { describeServerProcess } from "./triageSession.ts";
|
|
|
|
it.effect("reports the version the running server recorded, not the CLI's", () =>
|
|
Effect.gen(function* () {
|
|
const fs = yield* FileSystem.FileSystem;
|
|
const path = yield* Path.Path;
|
|
const statePath = path.join(
|
|
yield* fs.makeTempDirectoryScoped({ prefix: "hanzo-triage-" }),
|
|
"server-runtime.json",
|
|
);
|
|
const state = yield* makePersistedServerRuntimeState({
|
|
config: { host: undefined, devUrl: undefined },
|
|
port: 3773,
|
|
});
|
|
yield* persistServerRuntimeState({ path: statePath, state });
|
|
|
|
assert.equal(
|
|
yield* describeServerProcess(statePath),
|
|
`running (pid ${String(process.pid)}, http://127.0.0.1:3773, version ${packageJson.version})`,
|
|
);
|
|
}).pipe(Effect.provide(NodeServices.layer)),
|
|
);
|