-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Update the assert module summary to better describe the module #2799
Conversation
The current wording "This module is used for writing unit tests for your applications, you can access it with require('assert')." implies that this module should only be used in development while unit testing. The article "Error Handling in Node.js" by Joyent (https://www.joyent.com/developers/node/design/errors) uses the assert module in an efficient way to validate required function arguments.
@@ -2,7 +2,7 @@ | |||
|
|||
Stability: 2 - Stable | |||
|
|||
This module is used for writing unit tests for your applications, you can | |||
This module is used for testing actual values against expected values, you can |
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 you fix the comma splice? This modules is used for testing actual values against expected values. You can...
Correct comma splice
LGTM |
I don't know if I'm getting to nit-picky, but to me, the new sentence doesn't convey the right ideas about assertions. While it's true that assertions are Furthermore, the new wording may make it sound like assertions should be used as a general tool for comparing values, like it's a substitute for I feel like I do this on every single PR that has the |
The more I'm thinking about it, the more I think that although the original wording is imperfect for sure, it does a better job of conveying when you might use an assertion and at least implying that there's something special about them and that they are not a general library for comparing values. |
Perhaps a good summary of the utility of the module might be inspired by looking at the Wikipedia article on assertions. |
Good point @Trott. I'll figure out some wording that is accurate for the entire module. |
Keep the summary simple while describing the entire module.
Any thoughts on this @Trott ? |
LGTM |
@@ -2,8 +2,7 @@ | |||
|
|||
Stability: 2 - Stable | |||
|
|||
This module is used for writing unit tests for your applications, you can | |||
access it with `require('assert')`. | |||
This module is used for writing assertion tests. You can access it with `require('assert')`. |
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.
Please wrap at 80 chars. 92 is definately too much :)
Oh, and a descriptive commit title would be nice too. Just rename the PR if you're lazy and I'll commit it as that :) |
The current wording "This module is used for writing unit tests for your applications, you can access it with require('assert')." implies that this module should only be used in development while unit testing. The article "Error Handling in Node.js" by Joyent (https://www.joyent.com/developers/node/design/errors) uses the assert module in an efficient way to validate required function arguments. PR-URL: #2799 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Landed in 8e21309. There were a lot of things wrong here which I had to correct (patch didn't merge, commit message lines weren't wrapped). Please read CONTRIBUTING.md next time 😉. |
The current wording "This module is used for writing unit tests for your applications, you can access it with require('assert')." implies that this module should only be used in development while unit testing. The article "Error Handling in Node.js" by Joyent (https://www.joyent.com/developers/node/design/errors) uses the assert module in an efficient way to validate required function arguments. PR-URL: nodejs#2799 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
The current wording "This module is used for writing unit tests for your applications, you can access it with require('assert')." implies that this module should only be used in development while unit testing. The article "Error Handling in Node.js" by Joyent (https://www.joyent.com/developers/node/design/errors) uses the assert module in an efficient way to validate required function arguments. PR-URL: #2799 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
The current wording "This module is used for writing unit tests for your applications, you can access it with require('assert')." implies that this module should only be used in development while unit testing.
The article "Error Handling in Node.js" by Joyent (https://www.joyent.com/developers/node/design/errors) uses the assert module in an efficient way to validate required function arguments.