-
Notifications
You must be signed in to change notification settings - Fork 29
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
Clarify the function call in "to throw" documentation. #493
Conversation
Yeah, that's another downside of supporting node 0.10 -- we can't use arrow functions in the documentation code snippets :) |
did not throw | ||
``` | ||
|
||
Used with arrow functions this assertion is very elegant, and there | ||
are a couple of functionally equaivalent aliases provided to allow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
equivalent
@papandreou check. And re the arrow functions, honestly that's another vote to do as mocha do and go node 4+ in my book :) |
Or node 6+ while we're at it :) |
Hmm yeah - I only assumed we’d stick with 4 to be in line with mocha. |
@papandreou isn't the Node versions which we test and generate the documentation deciding if we can use arrow functions? I actually agree. Maybe we should just jump directly to Node v6+ |
@sunesimonsen, not sure I fully understood that? The code snippets in the documentation are executed via |
I can see people thinking "why wrap the function pointlessly when I can just pass the function and boom will be called for me". |
But yeah, that's for people who understand that you have to let the library call the function for you. How passing functions work is something that is easy mislearned, from what I have seen helping people with JavaScript. Trying to pass callbacks while you are actually executing them in the spot and passing whatever they return, etc. |
@dasilvacontin still very glad you reported it so we get a chance to hopefully improve things :) |
fbe9162
to
0689348
Compare
Quick note, I've rebased this on top of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
@alexjeffburke, is there anything holding this back, or should we get it into v11? |
@papandreou nothing from my side so yeah let's fold this in :) |
I keep stumbling upon this one, let's just get it in :) |
Yay! |
This PR hopes to address the concerns in issue #411.
The changes make the wrapping function clear and also include examples using arrow function syntax.