mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-22 18:25:32 -04:00
15 lines
478 B
TypeScript
15 lines
478 B
TypeScript
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)
|
|
})
|