1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[test] Rewritten test for fetch to free Promise

This commit is contained in:
Witold Filipczyk 2024-07-08 21:32:38 +02:00
parent a13ddcce89
commit 132c72c123

View File

@ -14,9 +14,20 @@ async function getData() {
} }
} }
console.error("fetch.html"); console.error("fetch.html");
var ex = 0;
getData().then(text => { getData().then(text => {
console.assert(text === 'Hello', 'hello'); console.assert(text === 'Hello', 'hello');
console.exit(); ex = 1;
}); });
function loop()
{
if (ex == 1) {
setTimeout(console.exit());
} else {
setTimeout(loop, 1);
}
}
loop();
</script> </script>