Re: Consider avoiding allSettled in tests (was: Re: Intent to ship: Promise.allSettled)

2019-11-01 Thread Kris Maglione
On Thu, Oct 31, 2019, 06:02 Jason Orendorff wrote: > Ignoring the awaited value here is like using `catch {}` to squelch all > exceptions, or ignoring the return value of an async function or method, or > any other expression that produces a Promise. Do we have lints for those > pitfalls? I'm kin

Re: Consider avoiding allSettled in tests

2019-11-01 Thread Paolo Amadini
On 10/31/2019 1:02 PM, Jason Orendorff wrote: On Thu, Oct 31, 2019 at 4:10 AM Paolo Amadini wrote: // INCORRECT //await Promise.allSettled([promise1, promise2]); The last example silently loses any rejection state. Ignoring the awaited value here is like using `catch {}` to squelch

Re: Consider avoiding allSettled in tests (was: Re: Intent to ship: Promise.allSettled)

2019-10-31 Thread Jason Orendorff
On Thu, Oct 31, 2019 at 4:10 AM Paolo Amadini wrote: >// INCORRECT >//await Promise.allSettled([promise1, promise2]); > > The last example silently loses any rejection state. > Ignoring the awaited value here is like using `catch {}` to squelch all exceptions, or ignoring the return valu

Consider avoiding allSettled in tests (was: Re: Intent to ship: Promise.allSettled)

2019-10-31 Thread Paolo Amadini
On 10/30/2019 10:19 PM, Jan-Ivar Bruaroey wrote: This always seemed trivial to me to do with:     Promise.all(promises.map(p => p.catch(e => e))) As Boris pointed out, this does not have proper exception handling. If exceptions should be ignored, it may be good to call "console.error". In case