Closed bonham000 closed 4 years ago
TIL Promise.allSettled
is a thing. Nice! As an aside, what happens with Promise.all
if one of them throws? Does the whole thing throw?
Break the tests with every commit 🤷
I support this 👍
Incidentally, the async challenges make the test loading state much more useful
Awesome, glad to hear
@iansinnott yes, Promise.all
will throw whenever any (the first) contained promise rejects, whereas Promise.allSettled
will wait for all contained promises to resolve or reject and then produce an array of data representing the results. Because of this, I think Promise.allSettled
should not throw errors.
This PR:
Promise.allSettled
type definitions to the extra Monaco type definitions.Notes:
in-browser
test utils which throws an error, for instance if you reference anundefined
value, this error gets thrown and misses all of the catch blocks we have around the code/test execution. This results in the Workspace never canceling the loading status and getting stuck in a tests loading state. I couldn't figure out why errors like this (although they should not happen because they represent broken test code) do not get caught. 🤔Coming Later: