-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
docs: Clarify assert.doesNotThrow behavior #2807
Conversation
|
||
Expects `block` not to throw an error, see `assert.throws` for details. | ||
Expects `block` not to throw an error, see `assert.throws` for more details. |
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.
While we're at it, can we fix the comma splice here? This should be two sentences. ...not to throw an error. See...
@Trott updated the branch with your suggestions |
|
||
Expects `block` not to throw an error, see `assert.throws` for details. | ||
Expects `block` not to throw an error. See `assert.throws` for more details. |
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.
Two more things (sorry!):
Should probably be assert.throws()
with the parentheses, and that text should probably link to the section of the document for assert.throws()
.
function() { | ||
throw new TypeError("Wrong value"); | ||
}, | ||
a.AssertionError |
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.
I think this might be clearer if you stayed away from AssertionError
. I'd go with maybe SyntaxError
.
I made several suggested changes with inline comments, but LGTM. /cc @nodejs/documentation |
@Trott thanks for the tips/suggestions. All should be fixed now. |
👍 LGTM |
The documentation for assert.doesNotThrow now reflects all the inputs the function accepts, as well as the errors thrown for each combination of parameter types.
e7e4c1a
to
e8bb02f
Compare
Pushed rebased commits |
LGTM. It would be good if someone from @nodejs/documentation could look at it just to make sure it conforms with any emerging or established documentation guidelines that I may be unaware of. |
The documentation for assert.doesNotThrow now reflects all the inputs the function accepts, as well as the errors thrown for each combination of parameter types. PR-URL: #2807 Reviewed-By: Rich Trott <[email protected]>
Landed in 79ebeab. Thanks! |
The documentation for assert.doesNotThrow now reflects all the inputs the function accepts, as well as the errors thrown for each combination of parameter types. PR-URL: #2807 Reviewed-By: Rich Trott <[email protected]>
Relates to #2385
The documentation now seems to be up to date with the code and tests for the
assert
module