* Create a plugin instance with DB in a temp directory. * Uses dynamic import to resolve routing module from project root.
(tempDir: string)
| 22 | * Uses dynamic import to resolve routing module from project root. |
| 23 | */ |
| 24 | async function createTestPlugin(tempDir: string) { |
| 25 | // Import the plugin module |
| 26 | const { ContextModePlugin } = await import("../src/adapters/opencode/plugin.js"); |
| 27 | |
| 28 | // Monkey-patch the session dir to use temp directory |
| 29 | // The plugin uses homedir() internally, but we can control the DB path |
| 30 | // by creating the plugin with a unique directory that produces a unique hash |
| 31 | return ContextModePlugin({ |
| 32 | directory: tempDir, |
| 33 | client: { |
| 34 | app: { |
| 35 | log: async () => {}, |
| 36 | }, |
| 37 | }, |
| 38 | }); |
| 39 | } |
| 40 | |
| 41 | // ── Tests ───────────────────────────────────────────────── |
| 42 |
no outgoing calls
no test coverage detected