chore: generate
This commit is contained in:
parent
c7efbe6fc0
commit
4ecc3ac653
2 changed files with 18 additions and 7 deletions
|
|
@ -130,7 +130,12 @@ describe("opencode run (non-interactive subprocess)", () => {
|
||||||
{ type: "step_finish", part: expect.objectContaining({ type: "step-finish" }) },
|
{ type: "step_finish", part: expect.objectContaining({ type: "step-finish" }) },
|
||||||
])
|
])
|
||||||
expect(result.stdout.endsWith("\n")).toBe(true)
|
expect(result.stdout.endsWith("\n")).toBe(true)
|
||||||
expect(result.stdout.split("\n").slice(0, -1).every((line) => line.length > 0)).toBe(true)
|
expect(
|
||||||
|
result.stdout
|
||||||
|
.split("\n")
|
||||||
|
.slice(0, -1)
|
||||||
|
.every((line) => line.length > 0),
|
||||||
|
).toBe(true)
|
||||||
}),
|
}),
|
||||||
60_000,
|
60_000,
|
||||||
)
|
)
|
||||||
|
|
@ -191,9 +196,18 @@ describe("opencode run (non-interactive subprocess)", () => {
|
||||||
expect.objectContaining({ type: "reasoning", text: "reasoning" }),
|
expect.objectContaining({ type: "reasoning", text: "reasoning" }),
|
||||||
)
|
)
|
||||||
expect(events.find((event) => event.type === "tool_use")?.part).toEqual(
|
expect(events.find((event) => event.type === "tool_use")?.part).toEqual(
|
||||||
expect.objectContaining({ type: "tool", tool: "bash", state: expect.objectContaining({ status: "completed" }) }),
|
expect.objectContaining({
|
||||||
|
type: "tool",
|
||||||
|
tool: "bash",
|
||||||
|
state: expect.objectContaining({ status: "completed" }),
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
expect(result.stdout.split("\n").slice(0, -1).every((line) => line.startsWith("{"))).toBe(true)
|
expect(
|
||||||
|
result.stdout
|
||||||
|
.split("\n")
|
||||||
|
.slice(0, -1)
|
||||||
|
.every((line) => line.startsWith("{")),
|
||||||
|
).toBe(true)
|
||||||
}),
|
}),
|
||||||
60_000,
|
60_000,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -270,10 +270,7 @@ export function withCliFixture<A, E>(
|
||||||
}
|
}
|
||||||
|
|
||||||
const run = (message: string, opts?: RunOpts): Effect.Effect<RunResult> => {
|
const run = (message: string, opts?: RunOpts): Effect.Effect<RunResult> => {
|
||||||
return spawn(
|
return spawn(runArgs(message, opts), runOpts(opts))
|
||||||
runArgs(message, opts),
|
|
||||||
runOpts(opts),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const startRun = Effect.fn("opencode.startRun")(function* (message: string, opts?: RunOpts) {
|
const startRun = Effect.fn("opencode.startRun")(function* (message: string, opts?: RunOpts) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue