From 883a0ea6b4b71ca0544e7f40d2d84ad637cadbc0 Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Sun, 25 Jan 2026 03:02:24 +0100 Subject: [PATCH] docs: clarify createMockLGraphNodeWithArrayBoundingRect usage Expand JSDoc to explain when to use createMockLGraphNodeWithArrayBoundingRect vs createMockLGraphNode, emphasizing that this creates a real LGraphNode instance with Float64Array boundingRect for position method testing. --- src/utils/__tests__/litegraphTestUtils.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/utils/__tests__/litegraphTestUtils.ts b/src/utils/__tests__/litegraphTestUtils.ts index d24a5e1ff..f73d0d91d 100644 --- a/src/utils/__tests__/litegraphTestUtils.ts +++ b/src/utils/__tests__/litegraphTestUtils.ts @@ -163,7 +163,21 @@ export function createMockNodeOutputSlot( } /** - * Creates a LGraphNode with Float64Array boundingRect for testing position methods + * Creates a real LGraphNode instance (not a lightweight mock) with its boundingRect + * property represented as a Float64Array for testing position methods. + * + * Use createMockLGraphNodeWithArrayBoundingRect when: + * - Tests rely on Float64Array boundingRect behavior + * - Tests call position-related methods like updateArea() + * - Tests need actual LGraphNode implementation details + * + * Use createMockLGraphNode when: + * - Tests only need simple/mock-only behavior + * - Tests don't depend on boundingRect being a Float64Array + * - A lightweight mock with minimal properties is sufficient + * + * @param name - The node name/type to pass to the LGraphNode constructor + * @returns A fully constructed LGraphNode instance with Float64Array boundingRect */ export function createMockLGraphNodeWithArrayBoundingRect( name: string