@@ -157,16 +157,12 @@ async function check(map: (dir: string) => string) { |
157 | 157 | } |
158 | 158 | } |
159 | 159 |
|
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 | +) |
170 | 166 |
|
171 | 167 | test("creates global jsonc config with schema when no global configs exist", async () => { |
172 | 168 | await using tmp = await tmpdir() |
@@ -346,27 +342,22 @@ test("loads project config from Cygwin paths on Windows", async () => { |
346 | 342 | }) |
347 | 343 | }) |
348 | 344 |
|
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 | +) |
370 | 361 |
|
371 | 362 | it.instance("loads JSONC config file", () => |
372 | 363 | Effect.gen(function* () { |
|