From 08fc8131f696219024988e6b631283fc83cadf8f Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Wed, 21 Jan 2026 14:00:56 +0100 Subject: [PATCH] test: remove any from textUtils.test.ts - Replace (ctx.measureText as any) with (ctx.measureText as Mock) - Import Mock type from vitest --- src/lib/litegraph/src/utils/textUtils.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/litegraph/src/utils/textUtils.test.ts b/src/lib/litegraph/src/utils/textUtils.test.ts index 8ca101f61..1fea535c6 100644 --- a/src/lib/litegraph/src/utils/textUtils.test.ts +++ b/src/lib/litegraph/src/utils/textUtils.test.ts @@ -1,3 +1,4 @@ +import type { Mock } from 'vitest' import { describe, expect, it, vi } from 'vitest' import { truncateText } from '@/lib/litegraph/src/litegraph' @@ -57,7 +58,7 @@ describe('truncateText', () => { // Verify binary search efficiency - should not measure every possible substring // Binary search for 100 chars should take around log2(100) ≈ 7 iterations // Plus a few extra calls for measuring the full text and ellipsis - const callCount = (ctx.measureText as any).mock.calls.length + const callCount = (ctx.measureText as Mock).mock.calls.length expect(callCount).toBeLessThan(20) expect(callCount).toBeGreaterThan(5) })