Ignore errors
Closed this issue · 2 comments
fregante commented
Like falsy return values, errors could also be ignored.
await pWaitFor(() => {
assert(system.time > '10:30')
}, {ignoreErrors: error => error instanceOf AssertionError})
sindresorhus commented
Yeah, I guess. It's only a tiny improvement over doing try/catch though.
How about calling it filterError
?
fregante commented
It's only a tiny improvement over doing try/catch though.
You're not wrong