v1
3/13/2023 by autopulated -00
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
// generate array of 1000 random callbacks, half of which are async
const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
var arr = [];
for (var i=0; i<1000; i++) {
	if(Math.random() < 0.5){
    	arr.push(new Function("a", "return a+1"))
    } else {
    	arr.push(new AsyncFunction("a", "return a+1"))
    }
}
delete caserun single casemove downdrag and drop case


ready





(async function(){

var x = 0;
for(const f of arr){
	let r = await f(x);
	x = r;
}

})().then(function(){deferred.resolve()})
delete caserun single casemove updrag and drop case


ready



(async function(){

var x = 0;
for(const f of arr){
	let r = f(x);
	if (typeof r?.then === 'function') {
        r = await r
    }
    x = r
}

})().then(function(){deferred.resolve()})
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN