mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 14:51:08 +00:00
refactor(plugins): separate activation from enablement (#59844)
* refactor(plugins): separate activation from enablement * fix(cli): sanitize verbose plugin activation reasons
This commit is contained in:
@@ -69,6 +69,28 @@ describe("plugins cli list", () => {
|
||||
expect(output).toContain("explicitly enabled: no");
|
||||
});
|
||||
|
||||
it("sanitizes activation reasons in verbose output", async () => {
|
||||
buildPluginSnapshotReport.mockReturnValue({
|
||||
plugins: [
|
||||
createPluginRecord({
|
||||
id: "demo",
|
||||
name: "Demo Plugin",
|
||||
activated: true,
|
||||
activationSource: "auto",
|
||||
activationReason: "\u001B[31mconfigured\nnext\tstep",
|
||||
}),
|
||||
],
|
||||
diagnostics: [],
|
||||
});
|
||||
|
||||
await runPluginsCommand(["plugins", "list", "--verbose"]);
|
||||
|
||||
const output = runtimeLogs.join("\n");
|
||||
expect(output).toContain("activation reason: configured\\nnext\\tstep");
|
||||
expect(output).not.toContain("\u001B[31m");
|
||||
expect(output.match(/activation reason:/g)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("keeps doctor on a module-loading snapshot", async () => {
|
||||
buildPluginDiagnosticsReport.mockReturnValue({
|
||||
plugins: [],
|
||||
|
||||
Reference in New Issue
Block a user