mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 18:56:12 +00:00
16 lines
588 B
TypeScript
16 lines
588 B
TypeScript
// Verifies plugin scope parsing and boundary checks.
|
|
import { describe, expect, it } from "vitest";
|
|
import { normalizePluginIdScope } from "./plugin-scope.js";
|
|
|
|
describe("normalizePluginIdScope", () => {
|
|
it("normalizes logical duplicates into a stable scope", () => {
|
|
expect(normalizePluginIdScope([" beta ", "alpha", "beta", ""])).toEqual(["alpha", "beta"]);
|
|
});
|
|
|
|
it("ignores non-string scope values instead of throwing", () => {
|
|
expect(
|
|
normalizePluginIdScope(["alpha", null, 42, { id: "beta" }, " beta "] as unknown[]),
|
|
).toEqual(["alpha", "beta"]);
|
|
});
|
|
});
|