-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
doc: improve assert docs #7815
doc: improve assert docs #7815
Conversation
/cc @nodejs/collaborators |
bbdbbf6
to
b144415
Compare
@nodejs/documentation |
doc/api/assert.md
Outdated
'strict equal' operator (`===`). If `actual` and `expected` are not equal, then | ||
an `AssertionError` exception is thrown. | ||
|
||
Object comparisons include a 'strict equal' check of their prototypes. |
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.
Nit: no scare quotes around strict equal
b144415
to
d111e9c
Compare
This commit uses more consistent language in function descriptions and adds function parameter and return type information.
d111e9c
to
9921539
Compare
|
||
## assert.deepEqual(actual, expected[, message]) | ||
<!-- YAML | ||
added: v0.1.21 | ||
--> | ||
|
||
Tests for deep equality between the `actual` and `expected` parameters. | ||
Primitive values are compared with the equal comparison operator ( `==` ). | ||
* `actual` {mixed} A value to check |
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.
Would Any be better instead of mixed?
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 used mixed
because that is what I'm used to seeing in the online PHP documentation when they refer to a parameter that can be any or many different types. I figured other people coming from PHP might find that term more familiar than something else. shrug
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.
Closure and JSDoc use {*}
c133999
to
83c7a88
Compare
@mscdex Are you up for rebasing this? |
Looks like most of these improvements or variations on them have already landed via other PRs. I'm going to go ahead and close this but absolutely feel free to re-open it if it's something you plan on rebasing and continuing to work on. |
Checklist
Affected core subsystem(s)
Description of change
Improve
assert
documentation by: