GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: migrate remaining simple config fixtures · Integralist/opencode@e53563f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/test/config
    • config.test.ts
  • perf
    • test-suite.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/test/config/config.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/config/config.test.ts
+22-31Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,12 @@ async function check(map: (dir: string) => string) {
157157
}
158158
}
159159

160-
test("loads config with defaults when no files exist", async () => {
161-
await using tmp = await tmpdir()
162-
await withTestInstance({
163-
directory: tmp.path,
164-
fn: async (ctx) => {
165-
const config = await load(ctx)
166-
expect(config.username).toBeDefined()
167-
},
168-
})
169-
})
160+
it.instance("loads config with defaults when no files exist", () =>
161+
Effect.gen(function* () {
162+
const config = yield* Config.Service.use((svc) => svc.get())
163+
expect(config.username).toBeDefined()
164+
}),
165+
)
170166

171167
test("creates global jsonc config with schema when no global configs exist", async () => {
172168
await using tmp = await tmpdir()
@@ -346,27 +342,22 @@ test("loads project config from Cygwin paths on Windows", async () => {
346342
})
347343
})
348344

349-
test("ignores legacy tui keys in opencode config", async () => {
350-
await using tmp = await tmpdir({
351-
init: async (dir) => {
352-
await writeConfig(dir, {
353-
$schema: "https://opencode.ai/config.json",
354-
model: "test/model",
355-
theme: "legacy",
356-
tui: { scroll_speed: 4 },
357-
})
358-
},
359-
})
360-
await withTestInstance({
361-
directory: tmp.path,
362-
fn: async (ctx) => {
363-
const config = await load(ctx)
364-
expect(config.model).toBe("test/model")
365-
expect((config as Record<string, unknown>).theme).toBeUndefined()
366-
expect((config as Record<string, unknown>).tui).toBeUndefined()
367-
},
368-
})
369-
})
345+
it.instance("ignores legacy tui keys in opencode config", () =>
346+
Effect.gen(function* () {
347+
const test = yield* TestInstance
348+
yield* writeConfigEffect(test.directory, {
349+
$schema: "https://opencode.ai/config.json",
350+
model: "test/model",
351+
theme: "legacy",
352+
tui: { scroll_speed: 4 },
353+
})
354+
355+
const config = yield* Config.Service.use((svc) => svc.get())
356+
expect(config.model).toBe("test/model")
357+
expect((config as Record<string, unknown>).theme).toBeUndefined()
358+
expect((config as Record<string, unknown>).tui).toBeUndefined()
359+
}),
360+
)
370361

371362
it.instance("loads JSONC config file", () =>
372363
Effect.gen(function* () {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.