fix: preserve runtime option defaults (#38118)
This commit is contained in:
parent
dd50d457b0
commit
7243bd9e12
5 changed files with 27 additions and 5 deletions
14
packages/server/test/options.test.ts
Normal file
14
packages/server/test/options.test.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { expect, test } from "bun:test"
|
||||
import { ServerOptions } from "@opencode-ai/server/options"
|
||||
import { Option, Schema } from "effect"
|
||||
|
||||
const decode = Schema.decodeUnknownOption(ServerOptions)
|
||||
|
||||
test("accepts ephemeral port zero", () => {
|
||||
expect(Option.isSome(decode({ port: 0 }))).toBe(true)
|
||||
})
|
||||
|
||||
test("rejects ports outside the valid range", () => {
|
||||
expect(Option.isNone(decode({ port: -1 }))).toBe(true)
|
||||
expect(Option.isNone(decode({ port: 65_536 }))).toBe(true)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue