test: plugin install + docker e2e

This commit is contained in:
Peter Steinberger
2026-01-12 01:16:42 +00:00
parent 2f4a248314
commit f13ae50ff8
4 changed files with 257 additions and 0 deletions

View File

@@ -103,4 +103,32 @@ describe("discoverClawdbotPlugins", () => {
expect(ids).toContain("pack/one");
expect(ids).toContain("pack/two");
});
it("derives unscoped ids for scoped packages", async () => {
const stateDir = makeTempDir();
const globalExt = path.join(stateDir, "extensions", "voice-call-pack");
fs.mkdirSync(path.join(globalExt, "src"), { recursive: true });
fs.writeFileSync(
path.join(globalExt, "package.json"),
JSON.stringify({
name: "@clawdbot/voice-call",
clawdbot: { extensions: ["./src/index.ts"] },
}),
"utf-8",
);
fs.writeFileSync(
path.join(globalExt, "src", "index.ts"),
"export default function () {}",
"utf-8",
);
const { candidates } = await withStateDir(stateDir, async () => {
const { discoverClawdbotPlugins } = await import("./discovery.js");
return discoverClawdbotPlugins({});
});
const ids = candidates.map((c) => c.idHint);
expect(ids).toContain("voice-call");
});
});