The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import * as OpenCodeRuntime from "./OpenCodeRuntime.ts"; |
| 4 | |
| 5 | describe("resolveOpenCodeServerPassword", () => { |
| 6 | it("uses the settings password when local settings and environment differ", () => { |
| 7 | expect( |
| 8 | OpenCodeRuntime.resolveOpenCodeServerPassword( |
| 9 | { |
| 10 | external: false, |
| 11 | serverPassword: "settings-password", |
| 12 | environment: { OPENCODE_SERVER_PASSWORD: "environment-password" }, |
| 13 | }, |
| 14 | {}, |
| 15 | ), |
| 16 | ).toBe("settings-password"); |
| 17 | }); |
| 18 | |
| 19 | it("does not send an inherited local password to an external server", () => { |
| 20 | expect( |
| 21 | OpenCodeRuntime.resolveOpenCodeServerPassword( |
| 22 | { external: true, environment: { OPENCODE_SERVER_PASSWORD: "local-secret" } }, |
| 23 | { OPENCODE_SERVER_PASSWORD: "inherited-secret" }, |
| 24 | ), |
| 25 | ).toBeUndefined(); |
| 26 | }); |
| 27 | }); |