Skip to content

Commit 862926b

Browse files
test(server): triage CLI test provides crypto services after merging main
AI-assisted; verified with the tests and tools listed above.
1 parent 24184bc commit 862926b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎apps/server/src/cli/triage.test.ts‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import * as NodeFS from "node:fs";
33
import * as NodePath from "node:path";
44

5+
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
56
import * as NodeServices from "@effect/platform-node/NodeServices";
67
import { TRIAGE_PROMPT_FILE_NAME } from "@t3tools/contracts";
78
import * as NetService from "@t3tools/shared/Net";
@@ -24,6 +25,9 @@ const FAILING_AGENT_WINDOWS = `@echo Error: There is not enough space on the dis
2425
@exit /b 1
2526
`;
2627

28+
const prependToPath = (dir: string) =>
29+
vi.stubEnv("PATH", `${dir}${NodePath.delimiter}${process.env.PATH ?? ""}`);
30+
2731
it.live("a failed agent launch points at the prompt it could not run", () =>
2832
Effect.gen(function* () {
2933
const fs = yield* FileSystem.FileSystem;
@@ -32,9 +36,7 @@ it.live("a failed agent launch points at the prompt it could not run", () =>
3236
NodeFS.writeFileSync(NodePath.join(binDir, "codex"), FAILING_AGENT_POSIX, { mode: 0o755 });
3337
NodeFS.writeFileSync(NodePath.join(binDir, "codex.cmd"), FAILING_AGENT_WINDOWS);
3438
yield* Effect.acquireRelease(
35-
Effect.sync(() =>
36-
vi.stubEnv("PATH", `${binDir}${NodePath.delimiter}${process.env.PATH ?? ""}`),
37-
),
39+
Effect.sync(() => prependToPath(binDir)),
3840
() => Effect.sync(() => vi.unstubAllEnvs()),
3941
);
4042
const previousExitCode = process.exitCode;
@@ -61,5 +63,9 @@ it.live("a failed agent launch points at the prompt it could not run", () =>
6163
assert.include(output, promptFilePath);
6264
assert.include(output, buildTriageLaunchPrompt(promptFilePath));
6365
assert.include(output, NodePath.join(NodePath.dirname(promptFilePath), "context.md"));
64-
}).pipe(Effect.provide(Layer.mergeAll(NodeServices.layer, NetService.layer, TestConsole.layer))),
66+
}).pipe(
67+
Effect.provide(
68+
Layer.mergeAll(NodeServices.layer, NodeCrypto.layer, NetService.layer, TestConsole.layer),
69+
),
70+
),
6571
);

0 commit comments

Comments
 (0)