23 lines · 795 B · TypeScript
RawDownload
import { describe, expect, it } from "vite-plus/test"; import { resolveOpenCodeConfigContent } from "./opencodeRuntime.ts"; describe("resolveOpenCodeConfigContent", () => {  it("prefers the caller environment over the inherited environment", () => {    expect(      resolveOpenCodeConfigContent(        { OPENCODE_CONFIG_CONTENT: '{"source":"caller"}' },        { OPENCODE_CONFIG_CONTENT: '{"source":"process"}' },      ),    ).toBe('{"source":"caller"}');  });   it("falls back to the inherited environment and then an empty config", () => {    expect(      resolveOpenCodeConfigContent(undefined, {        OPENCODE_CONFIG_CONTENT: '{"source":"process"}',      }),    ).toBe('{"source":"process"}');    expect(resolveOpenCodeConfigContent(undefined, {})).toBe("{}");  });});

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