Tests: isolate bundle surface fixtures

This commit is contained in:
Gustavo Madeira Santana
2026-03-16 11:03:17 +00:00
parent d61c08efbb
commit fdfa98cda8

View File

@@ -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");