mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 23:00:43 +00:00
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { createPluginBoundaryReport } from "../../scripts/plugin-boundary-report.js";
|
|
|
|
function requirePluginSdkSummary(summary: {
|
|
pluginSdk?: {
|
|
crossOwnerReservedImportCount?: unknown;
|
|
unusedReservedCount?: unknown;
|
|
};
|
|
}) {
|
|
if (!summary.pluginSdk) {
|
|
throw new Error("Expected plugin SDK summary");
|
|
}
|
|
return summary.pluginSdk;
|
|
}
|
|
|
|
describe("plugin-boundary-report", () => {
|
|
it("emits compact CI-safe summary JSON", () => {
|
|
const result = createPluginBoundaryReport([
|
|
"--summary",
|
|
"--json",
|
|
"--fail-on-cross-owner",
|
|
"--fail-on-unclassified-unused-reserved",
|
|
]);
|
|
const summary = JSON.parse(result.stdout) as {
|
|
pluginSdk?: {
|
|
crossOwnerReservedImportCount?: unknown;
|
|
unusedReservedCount?: unknown;
|
|
};
|
|
memoryHostSdk?: {
|
|
implementation?: unknown;
|
|
};
|
|
};
|
|
|
|
expect(result).toMatchObject({ exitCode: 0, stderr: "" });
|
|
const pluginSdk = requirePluginSdkSummary(summary);
|
|
expect(pluginSdk.crossOwnerReservedImportCount).toBe(0);
|
|
expect(pluginSdk.unusedReservedCount).toBe(0);
|
|
expect(["private-core-bridge", "private-package-core-integrated"]).toContain(
|
|
summary.memoryHostSdk?.implementation,
|
|
);
|
|
});
|
|
});
|