Update tests/setupJest.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
icslucas
2025-10-01 20:17:46 +02:00
committed by GitHub
parent 58eb4543a3
commit 00dcb5fca1
+4 -3
View File
@@ -31,11 +31,12 @@ global.WebAssembly.instantiateStreaming = jest.fn<
[Response | PromiseLike<Response>, WebAssembly.Imports?]
>(
async (
source: Response | PromiseLike<Response> | WebAssembly.Module,
source: Response | PromiseLike<Response>,
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();