@@ -243,28 +243,6 @@ describe("loader", () => {
|
243 | 243 | expect(event.messages).toEqual(["keep-hook"]); |
244 | 244 | }); |
245 | 245 | |
246 | | -it("should load a handler from a module", async () => { |
247 | | -// Create a test handler module |
248 | | -const handlerCode = ` |
249 | | - export default async function(event) { |
250 | | - // Test handler |
251 | | - } |
252 | | - `; |
253 | | -const handlerPath = await writeHandlerModule("test-handler.js", handlerCode); |
254 | | -const cfg = createEnabledHooksConfig([ |
255 | | -{ |
256 | | -event: "command:new", |
257 | | -module: path.basename(handlerPath), |
258 | | -}, |
259 | | -]); |
260 | | - |
261 | | -const count = await loadInternalHooks(cfg, tmpDir); |
262 | | -expect(count).toBe(1); |
263 | | - |
264 | | -const keys = getRegisteredEventKeys(); |
265 | | -expect(keys).toContain("command:new"); |
266 | | -}); |
267 | | - |
268 | 246 | it("should load multiple handlers", async () => { |
269 | 247 | // Create test handler modules |
270 | 248 | const handler1Path = await writeHandlerModule("handler1.js"); |
@@ -363,24 +341,6 @@ describe("loader", () => {
|
363 | 341 | } |
364 | 342 | }); |
365 | 343 | |
366 | | -it("should handle relative paths", async () => { |
367 | | -// Create a handler module |
368 | | -const handlerPath = await writeHandlerModule("relative-handler.js"); |
369 | | - |
370 | | -// Relative to workspaceDir (tmpDir) |
371 | | -const relativePath = path.relative(tmpDir, handlerPath); |
372 | | - |
373 | | -const cfg = createEnabledHooksConfig([ |
374 | | -{ |
375 | | -event: "command:new", |
376 | | -module: relativePath, |
377 | | -}, |
378 | | -]); |
379 | | - |
380 | | -const count = await loadInternalHooks(cfg, tmpDir); |
381 | | -expect(count).toBe(1); |
382 | | -}); |
383 | | - |
384 | 344 | it("keeps workspace hooks disabled by default until explicitly enabled", async () => { |
385 | 345 | await writeDiscoveredHook({ hookName: "workspace-hook" }); |
386 | 346 | |
|