mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-07 00:53:20 +00:00
test(opencode): cover new v2 httpapi routes
This commit is contained in:
parent
5e3026b5ce
commit
dbd0a5b8c9
1 changed files with 15 additions and 0 deletions
|
|
@ -626,6 +626,21 @@ const scenarios: Scenario[] = [
|
|||
),
|
||||
http.protected.get("/api/model", "v2.model.list").json(200, locationData(array)),
|
||||
http.protected.get("/api/provider", "v2.provider.list").json(200, locationData(array)),
|
||||
http.protected.get("/api/command", "v2.command.list").json(200, locationData(array)),
|
||||
http.protected.get("/api/skill", "v2.skill.list").json(200, locationData(array)),
|
||||
http.protected
|
||||
.get("/api/event", "v2.event.subscribe")
|
||||
.stream()
|
||||
.status(
|
||||
200,
|
||||
(ctx, result) =>
|
||||
Effect.sync(() => {
|
||||
check(result.contentType.includes("text/event-stream"), "v2 event should be an SSE stream")
|
||||
check(result.text.includes("server.connected"), "v2 event should emit initial connection event")
|
||||
check(result.text.includes(ctx.directory), "v2 event should include the resolved location")
|
||||
}),
|
||||
"status",
|
||||
),
|
||||
http.protected
|
||||
.get("/api/fs/read", "v2.fs.read")
|
||||
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue