Commit 3e9eb2c
test: fix stale PluginHookContract assertions for v1.4.2 plugin shape
The v1.4.2 migration (f9ea81e) changed plugins/ix-plugin.ts to export a
named `server` Plugin function that returns a registration object (a `tool`
map keyed by tool name + hook handlers like `tool.execute.after`). The
PluginHookContract test block was not updated in that commit and still
asserted the old default-export `{ name, tools[], hooks[] }` shape, so it
failed: `import(...).default` is undefined and there is no 5-hook array.
Update the three assertions to the actual contract: assert the `server`
named export is a function, invoke it (the ix-unavailable startup probe is
swallowed by its try/catch), and check the returned `tool` map has the 17
expected tools and a `tool.execute.after` hook handler.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 7630d86 commit 3e9eb2c
1 file changed
Lines changed: 28 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
155 | 168 | | |
156 | 169 | | |
157 | 170 | | |
158 | | - | |
159 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
160 | 176 | | |
161 | 177 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
165 | 181 | | |
166 | 182 | | |
0 commit comments