-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async throw error delay #98
Comments
Are you asking for this to be default behavior or opt-in?
How would it help?
|
I personally would like it to be the default (I think it is the safest), but I'd be happy either way.
That makes the change really easy / already available (once the package is updated) how the options are passed to Do you have a library that aggregates sync errors using
test('race condition', async () => {
// assume we expect a to throw an error for whatever reason
const a = path.resolve('a.js');
const b = path.resolve('b.js');
await expect(del([a, b])).rejects.toThrow();
const bExists = fs.existsSync(b);
// will intermittently pass
expect(bExists).toEqual(false);
}); |
Yeah, I like it. Let's try it without even an option at first and see if anyone complains. (Would be a major release, obviously).
Maybe we could add a utility method to |
Would you accept a PR that would change how async errors are thrown so the error is thrown after all pending files being deleted are removed? This would help deal with side effects a lot cleaner, especially when testing.
Similar to #90.
The text was updated successfully, but these errors were encountered: