-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: proposal common.expectsError nextTick option #29749
Comments
I (probably) wouldn't block it, but I think the first example is clear. I think the proposed API results in code where it is not immediately obvious what is going on. So someone will have to go and read the documentation, which increases friction. If anything, in the first example, I might avoid |
I share @Trott's opinion on this issue. I'd actually like to see |
Makes sense. |
I would like to propose a new option for
common.expectsError
which will indicate whether theerror
can be invoked in the same tick or not, e.g.I would like to be able to replace tests like this:
with
Would this make sense? It's quite often that one wants to test for callback errors and that they should be invoked asynchronously.
I think this would also help us actually making sure that callbacks are invoked asynchronously.
NOTE: Can I use
expectsError
to test for no error?The text was updated successfully, but these errors were encountered: