mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 22:10:43 +00:00
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { findPluginSdkWildcardReexports } from "../../scripts/check-plugin-sdk-wildcard-reexports.mjs";
|
|
|
|
describe("check-plugin-sdk-wildcard-reexports", () => {
|
|
it("flags wildcard re-exports from plugin-sdk subpaths", () => {
|
|
expect(
|
|
findPluginSdkWildcardReexports(
|
|
[
|
|
'export * from "openclaw/plugin-sdk/foo";',
|
|
'export type * from "openclaw/plugin-sdk/bar";',
|
|
'export { named } from "openclaw/plugin-sdk/foo";',
|
|
].join("\n"),
|
|
),
|
|
).toEqual([
|
|
{ line: 1, text: 'export * from "openclaw/plugin-sdk/foo";' },
|
|
{ line: 2, text: 'export type * from "openclaw/plugin-sdk/bar";' },
|
|
]);
|
|
});
|
|
|
|
it("allows explicit SDK exports and local wildcard barrels", () => {
|
|
expect(
|
|
findPluginSdkWildcardReexports(
|
|
[
|
|
'export { named } from "openclaw/plugin-sdk/foo";',
|
|
'export type { Named } from "openclaw/plugin-sdk/foo";',
|
|
'export * from "./src/runtime-api.js";',
|
|
].join("\n"),
|
|
),
|
|
).toEqual([]);
|
|
});
|
|
});
|