mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-03 08:52:56 +00:00
* refactor(plugins): trim activation and contract exports * test(plugins): restore fixture cleanup * refactor(plugins): trim install and loader exports * test(plugins): fully reset loader caches * refactor(plugins): trim metadata and catalog exports * test(plugins): preserve catalog trust coverage * refactor(plugins): trim provider and plugin exports * refactor(plugins): trim runtime and tool exports * test(plugins): update dead-export consumers * test(plugins): remove empty dead-export suites * refactor(plugins): align exports with split registry * refactor(plugins): trim drifted loader exports * style(plugins): format test fixtures * refactor(scripts): use supported plugin APIs * refactor(plugins): finish dead export cleanup * chore(deadcode): refresh export baseline * test(cli): mock production memory state * chore(deadcode): sync latest export baseline * fix(tests): keep plugin fixtures inside core * chore(deadcode): refresh rebased export baseline * chore(deadcode): sync current ratchets * fix(plugins): retain reserved slot invariant * fix(plugins): preserve dead-export invariants * test(plugins): use neutral catalog query fixture * test(plugins): satisfy catalog lint * test(plugins): preserve integrity drift coverage * fix(ci): register skill experience live proof
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
// Covers plugin config policy validation and ownership decisions.
|
|
import { describe, expect, it } from "vitest";
|
|
import { hasExplicitPluginConfig, normalizePluginsConfigWithResolver } from "./config-policy.js";
|
|
|
|
describe("normalizePluginsConfigWithResolver", () => {
|
|
it("uses the provided plugin id resolver for allow deny and entry keys", () => {
|
|
const normalized = normalizePluginsConfigWithResolver(
|
|
{
|
|
allow: [" alpha "],
|
|
deny: [" beta "],
|
|
entries: {
|
|
" gamma ": {
|
|
enabled: true,
|
|
},
|
|
},
|
|
},
|
|
(id) => id.trim().toUpperCase(),
|
|
);
|
|
|
|
expect(normalized.allow).toEqual(["ALPHA"]);
|
|
expect(normalized.deny).toEqual(["BETA"]);
|
|
expect(normalized.entries).toHaveProperty("GAMMA");
|
|
});
|
|
});
|
|
|
|
describe("hasExplicitPluginConfig", () => {
|
|
it("detects explicit config from slots and entry keys", () => {
|
|
expect(hasExplicitPluginConfig({ slots: { memory: "none" } })).toBe(true);
|
|
expect(hasExplicitPluginConfig({ entries: { foo: {} } })).toBe(true);
|
|
expect(hasExplicitPluginConfig({})).toBe(false);
|
|
});
|
|
});
|