From f315398b1a431f4f099aa0b97740022b6edd7452 Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Sun, 25 Jan 2026 02:55:29 +0100 Subject: [PATCH] test: add Symbol.iterator support to createMockFileList Add iterator implementation to createMockFileList so the mock FileList can be used with for...of loops and spread operations, ensuring full compatibility with the iterable FileList interface. --- src/utils/__tests__/litegraphTestUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/__tests__/litegraphTestUtils.ts b/src/utils/__tests__/litegraphTestUtils.ts index 39a6bd3fa9..d24a5e1ffa 100644 --- a/src/utils/__tests__/litegraphTestUtils.ts +++ b/src/utils/__tests__/litegraphTestUtils.ts @@ -180,7 +180,10 @@ export function createMockFileList(files: File[]): FileList { const fileList = { ...files, length: files.length, - item: (index: number) => files[index] ?? null + item: (index: number) => files[index] ?? null, + [Symbol.iterator]: function* () { + yield* files + } } return fileList as FileList }