Update the assert module summary to better describe the module#2799
Update the assert module summary to better describe the module#2799daveboivin wants to merge 4 commits intonodejs:masterfrom daveboivin:patch-1
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.
doc/api/assert.markdown
Outdated
There was a problem hiding this comment.
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 |
doc/api/assert.markdown
Outdated
There was a problem hiding this comment.
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.