Files
openclaw/src/plugins/plugin-scope.test.ts
Vincent Koc 6a189eec0b fix(plugins): centralize explicit plugin scope handling (#65298)
* fix(plugins): centralize explicit plugin scope handling

* fix(plugins): preserve explicit empty web scopes

* fix(plugins): preserve runtime web provider scopes without config

* fix(plugins): preserve web provider runtime filtering

* fix(plugins): preserve scoped web runtime fallback

* fix(plugins): harden plugin scope normalization
2026-04-12 16:16:37 +01:00

15 lines
534 B
TypeScript

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"]);
});
});