GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(opencode): stabilize Windows async readiness · soequelle/opencode@81851ca

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/test
    • server
      • httpapi-file.test.ts
    • session
      • prompt.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/test/server/httpapi-file.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/server/httpapi-file.test.ts
+15-5Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { afterEach, describe, expect, test } from "bun:test"
2-
import { Context } from "effect"
2+
import { Context, Effect } from "effect"
33
import path from "path"
44
import { HttpApiApp } from "../../src/server/routes/instance/httpapi/server"
55
import { FilePaths } from "../../src/server/routes/instance/httpapi/groups/file"
66
import { resetDatabase } from "../fixture/db"
77
import { disposeAllInstances, tmpdir } from "../fixture/fixture"
8+
import { pollWithTimeout } from "../lib/effect"
89

910
const context = Context.empty() as Context.Context<unknown>
1011

@@ -55,17 +56,26 @@ describe("file HttpApi", () => {
5556
await using tmp = await tmpdir({ git: true })
5657
await Bun.write(path.join(tmp.path, "hello.txt"), "needle")
5758

58-
const [text, files, symbols] = await Promise.all([
59+
const [text, symbols] = await Promise.all([
5960
request(FilePaths.findText, tmp.path, { pattern: "needle" }),
60-
request(FilePaths.findFile, tmp.path, { query: "hello", type: "file" }),
6161
request(FilePaths.findSymbol, tmp.path, { query: "hello" }),
6262
])
63+
const files = await Effect.runPromise(
64+
pollWithTimeout(
65+
Effect.promise(async () => {
66+
const response = await request(FilePaths.findFile, tmp.path, { query: "hello", type: "file" })
67+
const body = await response.json()
68+
return body.includes("hello.txt") ? { response, body } : undefined
69+
}),
70+
"file search index was not ready",
71+
),
72+
)
6373

6474
expect(text.status).toBe(200)
6575
expect(await text.json()).toContainEqual(expect.objectContaining({ line_number: 1 }))
6676

67-
expect(files.status).toBe(200)
68-
expect(await files.json()).toContain("hello.txt")
77+
expect(files.response.status).toBe(200)
78+
expect(files.body).toContain("hello.txt")
6979

7080
expect(symbols.status).toBe(200)
7181
expect(await symbols.json()).toEqual([])
Collapse file

‎packages/opencode/test/session/prompt.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/session/prompt.test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ it.instance(
16301630
expect(yield* llm.calls).toBe(1)
16311631
}),
16321632
{ git: true },
1633-
3_000,
1633+
10_000,
16341634
)
16351635

16361636
it.instance(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.