From 132c72c1231a24b929635d7856ff667826c18578 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Mon, 8 Jul 2024 21:32:38 +0200 Subject: [PATCH] [test] Rewritten test for fetch to free Promise --- test/ecmascript/assert/fetch.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/ecmascript/assert/fetch.html b/test/ecmascript/assert/fetch.html index 80e572b00..2165f6c03 100644 --- a/test/ecmascript/assert/fetch.html +++ b/test/ecmascript/assert/fetch.html @@ -14,9 +14,20 @@ async function getData() { } } console.error("fetch.html"); +var ex = 0; + getData().then(text => { console.assert(text === 'Hello', 'hello'); - console.exit(); + ex = 1; }); +function loop() +{ + if (ex == 1) { + setTimeout(console.exit()); + } else { + setTimeout(loop, 1); + } +} +loop();