Currently, when a Promise is still running in a script, it will end without waiting for them to finish. Is there a way to wait for all promises to finish and for the event loop to be before returning from evaluate on module? Example of usage
called does print in my console and attempting to print testFetch itself does indeed return a pending Promise, but attempting to await the promise does nothing. It simply never resolves and the console.log in the .then never gets called
Well I figured out my stupidity. Now I pass the resolve/reject functions to the function which is non async and call them when fetch is done. Out of curiosity would there be a way to natively support async callbacks?
Currently, when a Promise is still running in a script, it will end without waiting for them to finish. Is there a way to wait for all promises to finish and for the event loop to be before returning from
evaluate
on module? Example of usageIsolate code:
Node code:
called
does print in my console and attempting to print testFetch itself does indeed return a pending Promise, but attempting to await the promise does nothing. It simply never resolves and theconsole.log
in the.then
never gets called