forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin-boundary-report.test.ts
More file actions
43 lines (40 loc) 路 1.26 KB
/
Copy pathplugin-boundary-report.test.ts
File metadata and controls
43 lines (40 loc) 路 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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.exitCode).toBe(0);
expect(result.stderr).toBe("");
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,
);
});
});