refactor(plugins): print boundary success summary

This commit is contained in:
Vincent Koc
2026-04-07 12:05:24 +01:00
parent f856e0b72f
commit 721097f2e9
2 changed files with 47 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import { afterEach, describe, expect, it } from "vitest";
import {
acquireBoundaryCheckLock,
cleanupCanaryArtifactsForExtensions,
formatBoundaryCheckSuccessSummary,
formatStepFailure,
installCanaryArtifactCleanup,
resolveBoundaryCheckLockPath,
@@ -133,6 +134,26 @@ describe("check-extension-package-tsc-boundary", () => {
expect(message).toContain("demo-plugin timed out after 5000ms");
});
it("formats a success summary with counts and elapsed time", () => {
expect(
formatBoundaryCheckSuccessSummary({
mode: "all",
compileCount: 97,
canaryCount: 12,
elapsedMs: 54_321,
}),
).toBe(
[
"extension package boundary check passed",
"mode: all",
"compiled plugins: 97",
"canary plugins: 12",
"elapsed: 54321ms",
"",
].join("\n"),
);
});
it("keeps full failure output on the thrown error for canary detection", async () => {
await expect(
runNodeStepAsync(