refactor(plugins): stream boundary prep step output

This commit is contained in:
Vincent Koc
2026-04-07 11:37:54 +01:00
parent 525e78e3d9
commit 0ca8eb40c1
2 changed files with 63 additions and 11 deletions

View File

@@ -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");
});
});