mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-12 22:09:48 +08:00
chore: release v1.118.0
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { test, expect } from "bun:test";
|
||||
import { parseEventStream, hasImageGenInvocation, parseFinalJson } from "./parser.ts";
|
||||
import { parseEventStream, hasImageGenInvocation } from "./parser.ts";
|
||||
|
||||
const REAL_PoC_STREAM = `{"type":"thread.started","thread_id":"019e40d3-30e3-7030-874d-773bc0d6d1eb"}
|
||||
{"type":"turn.started"}
|
||||
@@ -41,19 +41,6 @@ test("hasImageGenInvocation finds shell calls touching generated_images", () =>
|
||||
expect(hasCp).toBe(true);
|
||||
});
|
||||
|
||||
test("parseFinalJson extracts {status:ok, path, bytes}", () => {
|
||||
expect(parseFinalJson('{"status":"ok","path":"/tmp/a.png","bytes":1234}')).toEqual({
|
||||
path: "/tmp/a.png",
|
||||
bytes: 1234,
|
||||
});
|
||||
expect(parseFinalJson("garbage text {\"status\":\"ok\",\"path\":\"/x\",\"bytes\":5} trailer")).toEqual({
|
||||
path: "/x",
|
||||
bytes: 5,
|
||||
});
|
||||
expect(parseFinalJson(null)).toBeNull();
|
||||
expect(parseFinalJson('{"status":"error","reason":"x"}')).toBeNull();
|
||||
});
|
||||
|
||||
test("hasImageGenInvocation (proper) returns false when no image_gen tool", () => {
|
||||
expect(hasImageGenInvocation([{ id: "1", tool: "shell", status: "completed" }])).toBe(false);
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user