Files
reverse-engineering-anything/src/desktop/DesktopSessionRequests.test.ts
T
morluto 5044e20171 test: focus diagnostics and evidence checks on behavior (#9303)
* test: focus configuration diagnostics on their owners

Preserve shape errors, selected paths, recovery guidance, and unchanged-file behavior across parser, setup, and uninstall boundaries.

* test: focus artifact and evidence checks on behavior

Retain format, identity, malformed-input, and cleanup coverage while removing fixed prose and closing the admitted test source.

* refactor(debugger): use configured session admission limits

* test: focus evidence and diagnostics on behavior

* fix(test): restore verifier export and formatting

* test(config): verify debugger limit ranges

* test(rizin): keep fixture executable authoritative

* test(rizin): isolate debugger fixture environment
2026-11-08 16:39:20 +00:00

38 lines
1.2 KiB
TypeScript

import { createInterface } from "node:readline";
import { PassThrough } from "node:stream";
import { setImmediate as tick } from "node:timers/promises";
import { describe, expect, it } from "vitest";
import { SessionRequestQueue } from "./DesktopSessionRequests.js";
describe("SessionRequestQueue", () => {
it("queues lines in order and treats the end of input as stop", async () => {
const input = new PassThrough();
const queue = new SessionRequestQueue(
createInterface({ input, terminal: false }),
);
input.end(
" stop \n\n \ncheckpoint\ncheckpoint \ncheckpoint saved file\ntyped\ncheckpoint-2\ncheckpoints\n",
);
await tick();
await tick();
expect(Array.from({ length: 11 }, () => queue.next())).toEqual([
{ kind: "stop" },
{ kind: "checkpoint", name: undefined },
{ kind: "checkpoint", name: undefined },
{ kind: "checkpoint", name: undefined },
{ kind: "checkpoint", name: undefined },
{ kind: "checkpoint", name: "saved file" },
{ kind: "checkpoint", name: "typed" },
{ kind: "checkpoint", name: "checkpoint-2" },
{ kind: "checkpoint", name: "checkpoints" },
{ kind: "stop" },
undefined,
]);
queue.close();
});
});