Skip to content

Commit dda159f

Browse files
committed
fix(test): replace any type with proper mock type in plugin test
Signed-off-by: leocavalcante <[email protected]>
1 parent fb28306 commit dda159f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/plugin.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, expect, it } from "bun:test"
22
import type { PluginInput } from "@opencode-ai/plugin"
3+
import type { Event } from "@opencode-ai/sdk"
34
import { OpenCoderPlugin } from "../src/plugin"
45

56
describe("OpenCoderPlugin", () => {
@@ -41,11 +42,11 @@ describe("OpenCoderPlugin", () => {
4142
const result = await OpenCoderPlugin(createMockContext())
4243

4344
// Event hook should be callable without throwing
44-
const mockEvent = {
45-
type: "session.created" as const,
45+
const mockEvent: Event = {
46+
type: "session.idle",
4647
properties: { sessionID: "test-123" },
4748
}
48-
await expect(result.event?.({ event: mockEvent as any })).resolves.toBeUndefined()
49+
await expect(result.event?.({ event: mockEvent })).resolves.toBeUndefined()
4950
})
5051

5152
it("should have callable tool.execute.before hook", async () => {

0 commit comments

Comments
 (0)