penpot/.opencode/test/penpot.test.js
Andrey Antukh 992170a9a4 🐛 Remove OpenCode V1 plugin support
Remove the legacy @opencode-ai/plugin import and V1 server export so
the local plugin loads under OpenCode V2 without project dependencies.

Add a focused smoke test for the V2 export and tool registration, and
update the related script memories.

AI-assisted-by: space-bunny-free
2026-09-23 18:53:25 +02:00

33 lines
715 B
JavaScript

import assert from "node:assert/strict"
import test from "node:test"
import plugin from "../plugins/penpot.js"
test("exports only the OpenCode V2 plugin contract", () => {
assert.equal(plugin.id, "penpot")
assert.equal("server" in plugin, false)
})
test("registers the Penpot tools during setup", async () => {
const tools = []
const context = {
location: { directory: "/tmp/opencode/penpot-plugin-test" },
tool: {
async transform(apply) {
apply({
add(tool) {
tools.push(tool)
},
})
},
},
}
await plugin.setup(context)
assert.deepEqual(
tools.map((tool) => tool.name).sort(),
["paren-repair", "penpot-psql"],
)
})