From 2952798e4f2dabf2026f255a4ec0c09f05400d4c Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 18:49:15 +0200 Subject: [PATCH] Add type, size, and arrayBuffer properties to the File object --- tests/domain/model-import.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/domain/model-import.test.ts b/tests/domain/model-import.test.ts index 540feb6e..c1e68926 100644 --- a/tests/domain/model-import.test.ts +++ b/tests/domain/model-import.test.ts @@ -14,11 +14,14 @@ function createTestFile(bytes: Uint8Array | Buffer, name: string, type: string): const arrayBuffer = new ArrayBuffer(bytes.byteLength); new Uint8Array(arrayBuffer).set(bytes); - return Object.assign(new Blob([arrayBuffer], { type }), { + return { name, + type, lastModified: Date.now(), - webkitRelativePath: "" - }) as File; + size: arrayBuffer.byteLength, + webkitRelativePath: "", + arrayBuffer: async () => arrayBuffer.slice(0) + } as File; } describe("model import", () => {