Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

mscdex
Copy link
Contributor

@mscdex mscdex commented Jul 21, 2016

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
  • doc
Description of change

Improve assert documentation by:

  • Reorganizing link references
  • Using consistent and concise language in function descriptions
  • Documenting function parameters and return types

@mscdex mscdex added assert Issues and PRs related to the assert subsystem. doc Issues and PRs related to the documentations. labels Jul 21, 2016
@mscdex
Copy link
Contributor Author

mscdex commented Jul 21, 2016

/cc @nodejs/collaborators

@mscdex mscdex changed the title Doc improve assert doc: improve assert docs Jul 21, 2016
@targos
Copy link
Member

targos commented Jul 21, 2016

@nodejs/documentation

'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.
Copy link
Member

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

This commit uses more consistent language in function descriptions
and adds function parameter and return type information.

## 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
Copy link
Contributor

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?

Copy link
Contributor Author

@mscdex mscdex Jul 21, 2016

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closure and JSDoc use {*}

@Trott
Copy link
Member

Trott commented Feb 24, 2017

@mscdex Are you up for rebasing this?

@Trott
Copy link
Member

Trott commented Mar 22, 2017

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.

@Trott Trott closed this Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants