diff --git a/tests/browser_test.mjs b/tests/browser_test.mjs index 5c7a717..bf71c53 100644 --- a/tests/browser_test.mjs +++ b/tests/browser_test.mjs @@ -25,7 +25,13 @@ const pause=ms=>new Promise(r=>setTimeout(r,ms)); let stderr='';chrome.stderr.on('data',data=>stderr+=data.toString()); const clients=[]; let kanban,testMachine; -async function waitFor(fn,description,timeout=30000){const end=Date.now()+timeout;while(Date.now()/navigated or closed|context was destroyed|Cannot find (default )?(execution )?context/i + .test(String(error?.message||error)); +async function waitFor(fn,description,timeout=30000){const end=Date.now()+timeout;while(Date.now(){const d=JSON.parse(event.data);if(d.id){const p=this.pending.get(d.id);if(p){this.pending.delete(d.id);d.error?p.reject(d.error):p.resolve(d.result);}}else if(d.method==='Runtime.exceptionThrown')this.errors.push(d.params.exceptionDetails);};