From 97ecec0cb104443eba9f22810e25cf57fc287ed3 Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Sun, 25 Jan 2026 02:54:29 +0100 Subject: [PATCH] test: replace MockEvents with Partial in ToOutputRenderLink.test.ts Remove the bespoke MockEvents interface and use typed Partial of the real CustomEventTarget for event mocks to ensure alignment with the actual type contract. --- .../litegraph/src/canvas/ToOutputRenderLink.test.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/lib/litegraph/src/canvas/ToOutputRenderLink.test.ts b/src/lib/litegraph/src/canvas/ToOutputRenderLink.test.ts index f66be8e79..7c9706ee6 100644 --- a/src/lib/litegraph/src/canvas/ToOutputRenderLink.test.ts +++ b/src/lib/litegraph/src/canvas/ToOutputRenderLink.test.ts @@ -13,13 +13,6 @@ import { createMockNodeOutputSlot } from '@/utils/__tests__/litegraphTestUtils' -interface MockEvents { - addEventListener: ReturnType - removeEventListener: ReturnType - dispatchEvent: ReturnType - dispatch: ReturnType -} - describe('ToOutputRenderLink', () => { describe('connectToOutput', () => { it('should return early if inputNode is null', () => { @@ -47,7 +40,7 @@ describe('ToOutputRenderLink', () => { const mockTargetNode = createMockLGraphNode({ connectSlots: vi.fn() }) - const mockEvents: MockEvents = { + const mockEvents: Partial> = { addEventListener: vi.fn(), removeEventListener: vi.fn(), dispatchEvent: vi.fn(), @@ -87,7 +80,7 @@ describe('ToOutputRenderLink', () => { const mockTargetNode = createMockLGraphNode({ connectSlots: vi.fn().mockReturnValue(mockNewLink) }) - const mockEvents: MockEvents = { + const mockEvents: Partial> = { addEventListener: vi.fn(), removeEventListener: vi.fn(), dispatchEvent: vi.fn(),