7582a88d6b
- types.ts: START/END, RoleMeta, ThreadContext, Role, Moderator, WorkflowDefinition - engine.ts: executeThread with JSONL persistence + AbortSignal - worker.ts: per-bundle process, TCP IPC, kill individual threads - CLI: run/ps/kill/threads/thread/thread rm commands - 32 tests pass, biome clean 小橘 <xiaoju@shazhou.work>
22 lines
437 B
TypeScript
22 lines
437 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
|
|
import { err, ok } from "../src/result.js";
|
|
|
|
describe("result helpers", () => {
|
|
test("ok wraps value", () => {
|
|
const r = ok(42);
|
|
expect(r.ok).toBe(true);
|
|
if (r.ok) {
|
|
expect(r.value).toBe(42);
|
|
}
|
|
});
|
|
|
|
test("err wraps error", () => {
|
|
const r = err("nope");
|
|
expect(r.ok).toBe(false);
|
|
if (!r.ok) {
|
|
expect(r.error).toBe("nope");
|
|
}
|
|
});
|
|
});
|