mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
refactor(plugins): stream boundary prep step output
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user