mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 17:20:25 +00:00
20 lines
655 B
TypeScript
20 lines
655 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { createPrefixedOutputWriter } from "../../scripts/prepare-extension-package-boundary-artifacts.mjs";
|
|
|
|
describe("prepare-extension-package-boundary-artifacts", () => {
|
|
it("prefixes each completed line and flushes the trailing partial line", () => {
|
|
let output = "";
|
|
const writer = createPrefixedOutputWriter("boundary", {
|
|
write(chunk: string) {
|
|
output += chunk;
|
|
},
|
|
});
|
|
|
|
writer.write("first line\nsecond");
|
|
writer.write(" line\nthird");
|
|
writer.flush();
|
|
|
|
expect(output).toBe("[boundary] first line\n[boundary] second line\n[boundary] third");
|
|
});
|
|
});
|