From 00dcb5fca129d0269de12ed1a2a37076f1ef4e41 Mon Sep 17 00:00:00 2001 From: icslucas Date: Wed, 1 Oct 2025 20:17:46 +0200 Subject: [PATCH] Update tests/setupJest.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- tests/setupJest.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/setupJest.ts b/tests/setupJest.ts index 761aa6341..bbb52f47a 100644 --- a/tests/setupJest.ts +++ b/tests/setupJest.ts @@ -31,11 +31,12 @@ global.WebAssembly.instantiateStreaming = jest.fn< [Response | PromiseLike, WebAssembly.Imports?] >( async ( - source: Response | PromiseLike | WebAssembly.Module, + source: Response | PromiseLike, importObject: WebAssembly.Imports | undefined, ) => { - if (source instanceof WebAssembly.Module) { - return WebAssembly.instantiate(source, importObject); + const response = await source; + const buffer = await response.arrayBuffer(); + return WebAssembly.instantiate(buffer, importObject); } const response = await source; const buffer = await response.arrayBuffer();