mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 12:00:43 +00:00
* 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
15 lines
534 B
TypeScript
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"]);
|
|
});
|
|
});
|