mirror of
https://github.com/anomalyco/opencode.git
synced 2026-10-29 19:30:04 +00:00
25 lines
728 B
TypeScript
25 lines
728 B
TypeScript
import { expect, test } from "bun:test"
|
|
import { fileURLToPath } from "node:url"
|
|
|
|
test("LocalProvider selection integration", async () => {
|
|
// Isolate provider module substitutions from the rest of the browser suite.
|
|
const child = Bun.spawn(
|
|
[
|
|
process.execPath,
|
|
"test",
|
|
"--conditions=browser",
|
|
"--preload",
|
|
"./happydom.ts",
|
|
"./test-browser/fixtures/model-selection.ts",
|
|
],
|
|
{ cwd: fileURLToPath(new URL("..", import.meta.url)), stdout: "pipe", stderr: "pipe" },
|
|
)
|
|
|
|
const [status, stdout, stderr] = await Promise.all([
|
|
child.exited,
|
|
new Response(child.stdout).text(),
|
|
new Response(child.stderr).text(),
|
|
])
|
|
|
|
expect(status, stdout + stderr).toBe(0)
|
|
}, 30_000)
|