Drop Config Info Zod static (#26933)
This commit is contained in:
@@ -251,7 +251,7 @@ test("updates global config and omits empty shell key in jsonc", async () => {
|
||||
|
||||
const file = path.join(tmp.path, "opencode.jsonc")
|
||||
const writtenConfig = await Filesystem.readText(file)
|
||||
const parsed = ConfigParse.schema(Config.Info.zod, ConfigParse.jsonc(writtenConfig, file), file)
|
||||
const parsed = ConfigParse.effectSchema(Config.Info, ConfigParse.jsonc(writtenConfig, file), file)
|
||||
expect(writtenConfig).not.toContain('"shell"')
|
||||
expect(parsed.shell).toBeUndefined()
|
||||
expect(parsed.model).toBe("test/model")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { afterEach, describe, expect, mock, test } from "bun:test"
|
||||
import { APICallError } from "ai"
|
||||
import { Cause, Deferred, Effect, Exit, Fiber, Layer } from "effect"
|
||||
import { Cause, Deferred, Effect, Exit, Fiber, Layer, Schema } from "effect"
|
||||
import * as Stream from "effect/Stream"
|
||||
import { Bus } from "../../src/bus"
|
||||
import { Config } from "@/config/config"
|
||||
@@ -211,7 +211,7 @@ function layer(result: "continue" | "compact") {
|
||||
}
|
||||
|
||||
function cfg(compaction?: Config.Info["compaction"]) {
|
||||
const base = Config.Info.zod.parse({})
|
||||
const base = Schema.decodeUnknownSync(Config.Info)({}) as Config.Info
|
||||
return TestConfig.layer({
|
||||
get: () => Effect.succeed({ ...base, compaction }),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user