Files
openclaw/test/scripts/check-deprecated-api-usage.test.ts
2026-05-25 13:45:08 +01:00

24 lines
967 B
TypeScript

import { describe, expect, it } from "vitest";
import { buildDeprecatedPluginSdkModuleSpecifiers } from "../../scripts/lib/deprecated-plugin-sdk-usage.mjs";
import deprecatedPublicPluginSdkSubpaths from "../../scripts/lib/plugin-sdk-deprecated-public-subpaths.json" with { type: "json" };
describe("scripts/check-deprecated-api-usage", () => {
it("bans every curated deprecated public plugin SDK subpath", () => {
const specifiers = new Set(buildDeprecatedPluginSdkModuleSpecifiers());
for (const subpath of deprecatedPublicPluginSdkSubpaths) {
expect(specifiers.has(`openclaw/plugin-sdk/${subpath}`), subpath).toBe(true);
}
});
it("keeps root and private compatibility aliases explicit", () => {
expect(buildDeprecatedPluginSdkModuleSpecifiers()).toEqual(
expect.arrayContaining([
"openclaw/plugin-sdk",
"openclaw/plugin-sdk/agent-dir-compat",
"openclaw/plugin-sdk/test-utils",
]),
);
});
});