AGENTS.md
packages/opencode/test/server/AGENTS.mdAGENTS.md
Quality
38/100
Scores the file, not the repository.Length
239 words
1 headings · 0 code blocksRepository
193k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# Server Test Guide23Use these patterns for server and HttpApi middleware tests in this directory.45- Prefer focused middleware tests with tiny fake routes over full API route trees when testing routing, context, proxying, or middleware policy.6- Use `testEffect(...)` with `NodeHttpServer.layerTest` for the primary in-test server and make relative `HttpClient` requests against it.7- Use tiny `HttpApiBuilder` probe groups that declare the typed middleware under test and expose context such as `WorkspaceRouteContext`, `InstanceRef`, or `WorkspaceRef`.8- Declare middleware in the same order as production when testing interactions, for example `InstanceContextMiddleware` followed by `WorkspaceRoutingMiddleware`.9- For secondary upstream servers, build Effect `NodeHttpServer.layer(...)` into the current test scope with `Layer.build(...)` so the listener stays alive until the test scope exits.10- Avoid `Bun.serve` when testing Effect HTTP middleware. Keep the test in the Effect HTTP stack unless the production path being tested is Bun-specific.11- For WebSocket paths, use `Socket.makeWebSocket(...)` from the test client and assert protocol forwarding or frame relay when relevant.12- Use scoped test layers for flags, database reset, and other global mutable state. Restore flags and reset state in finalizers.13- Use `tmpdirScoped({ git: true })` plus `Project.use.fromDirectory(dir)` for project-backed requests.14- If a test needs persisted state without matching runtime state, keep direct database setup inside a narrowly named helper that explains that state.15- Add comments for non-obvious test topology, especially tests involving both the local test server and a fake upstream server.16
Also in anomalyco/opencode
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| anomalyco/opencodeAGENTS.md · 193k | AGENTS.md | testlint-formatstyletypes+3 | 80/100 | 3 days ago | |
| anomalyco/opencodepackages/app/AGENTS.md · 193k | AGENTS.md | style | 56/100 | 3 days ago | |
| anomalyco/opencodepackages/app/e2e/performance/AGENTS.md · 193k | AGENTS.md | no sections | 16/100 | 3 days ago | |
| anomalyco/opencodepackages/codemode/AGENTS.md · 193k | AGENTS.md | api | 43/100 | 3 days ago | |
| anomalyco/opencodepackages/core/src/tool/AGENTS.md · 193k | AGENTS.md | stylesecurity | 58/100 | 3 days ago | |
| anomalyco/opencodepackages/effect-drizzle-sqlite/AGENTS.md · 193k | AGENTS.md | database | 38/100 | 3 days ago | |
| anomalyco/opencodepackages/llm/AGENTS.md · 193k | AGENTS.md | stylearchtesting-strategygit+1 | 57/100 | 3 days ago | |
| anomalyco/opencodepackages/opencode/src/server/routes/instance/httpapi/AGENTS.md · 193k | AGENTS.md | styleapi | 40/100 | 3 days ago | |
| anomalyco/opencodepackages/opencode/src/session/llm/AGENTS.md · 193k | AGENTS.md | arch | 61/100 | 3 days ago | |
| anomalyco/opencodepackages/opencode/test/AGENTS.md · 193k | AGENTS.md | teststylearchtesting-strategy+1 | 81/100 | 3 days ago | |
| anomalyco/opencodepackages/schema/AGENTS.md · 193k | AGENTS.md | styletypesdatabaseapi+1 | 65/100 | 3 days ago | |
| anomalyco/opencodepackages/opencode/AGENTS.md · 193k | AGENTS.md | styledatabaseapido-not | 81/100 | 3 days ago |
Diff against AGENTS.md Diff against packages/app/AGENTS.md Diff against packages/app/e2e/performance/AGENTS.md Diff against packages/codemode/AGENTS.md Diff against packages/core/src/tool/AGENTS.md Diff against packages/effect-drizzle-sqlite/AGENTS.md Diff against packages/llm/AGENTS.md Diff against packages/opencode/src/server/routes/instance/httpapi/AGENTS.md Diff against packages/opencode/src/session/llm/AGENTS.md Diff against packages/opencode/test/AGENTS.md Diff against packages/schema/AGENTS.md Diff against packages/opencode/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/inference/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+3 | 100/100 | 3 days ago |
