From fdfa98cda84285cc1ca825d8976d9007dc8fc667 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Mon, 16 Mar 2026 11:03:17 +0000 Subject: [PATCH] Tests: isolate bundle surface fixtures --- src/plugins/loader.test.ts | 50 +++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/plugins/loader.test.ts b/src/plugins/loader.test.ts index c70c0f5c3b3..740db382095 100644 --- a/src/plugins/loader.test.ts +++ b/src/plugins/loader.test.ts @@ -393,7 +393,9 @@ describe("bundle plugins", () => { }); it("treats Claude command roots and settings as supported bundle surfaces", () => { + useNoBundledPlugins(); const workspaceDir = makeTempDir(); + const stateDir = makeTempDir(); const bundleRoot = path.join(workspaceDir, ".openclaw", "extensions", "claude-skills"); mkdirSafe(path.join(bundleRoot, "commands")); fs.writeFileSync( @@ -402,19 +404,22 @@ describe("bundle plugins", () => { ); fs.writeFileSync(path.join(bundleRoot, "settings.json"), '{"hideThinkingBlock":true}', "utf-8"); - const registry = loadOpenClawPlugins({ - workspaceDir, - config: { - plugins: { - entries: { - "claude-skills": { - enabled: true, + const registry = withEnv({ OPENCLAW_STATE_DIR: stateDir }, () => + loadOpenClawPlugins({ + workspaceDir, + onlyPluginIds: ["claude-skills"], + config: { + plugins: { + entries: { + "claude-skills": { + enabled: true, + }, }, }, }, - }, - cache: false, - }); + cache: false, + }), + ); const plugin = registry.plugins.find((entry) => entry.id === "claude-skills"); expect(plugin?.status).toBe("loaded"); @@ -432,7 +437,9 @@ describe("bundle plugins", () => { }); it("treats Cursor command roots as supported bundle skill surfaces", () => { + useNoBundledPlugins(); const workspaceDir = makeTempDir(); + const stateDir = makeTempDir(); const bundleRoot = path.join(workspaceDir, ".openclaw", "extensions", "cursor-skills"); mkdirSafe(path.join(bundleRoot, ".cursor-plugin")); mkdirSafe(path.join(bundleRoot, ".cursor", "commands")); @@ -448,19 +455,22 @@ describe("bundle plugins", () => { "---\ndescription: fixture\n---\n", ); - const registry = loadOpenClawPlugins({ - workspaceDir, - config: { - plugins: { - entries: { - "cursor-skills": { - enabled: true, + const registry = withEnv({ OPENCLAW_STATE_DIR: stateDir }, () => + loadOpenClawPlugins({ + workspaceDir, + onlyPluginIds: ["cursor-skills"], + config: { + plugins: { + entries: { + "cursor-skills": { + enabled: true, + }, }, }, }, - }, - cache: false, - }); + cache: false, + }), + ); const plugin = registry.plugins.find((entry) => entry.id === "cursor-skills"); expect(plugin?.status).toBe("loaded");