test: improve the code in test-process-cpuUsage#10714
test: improve the code in test-process-cpuUsage#10714edsadr wants to merge 1 commit intonodejs:masterfrom
Conversation
There was a problem hiding this comment.
Can you add ^ and $ to these regular expressions.
0102f0f to
b659719
Compare
|
@cjihrig sorry, forgot that... just fixed it |
There was a problem hiding this comment.
Any reason to not write these as:
const invalidUserArgument =
/^TypeError: value of user property of argument is invalid$/There was a problem hiding this comment.
@cjihrig, honestIy would like to do it that way ... but can not find consensus about identation, got requests to change things when doing something like that in previous commits ... is there any document detailing the official code style? the linter seems to be fine with the previous commits but reviewers don't agree... so... would really love to understand when is fine to use an identation like the one you are suggesting and when I should keep it in line after the =
There was a problem hiding this comment.
I believe the official style is what I suggested (although I can't remember if the indentation on the next line is supposed to be 2 or 4 spaces).
There was a problem hiding this comment.
I think 4 (i.e. an extra indent to separate it from any indented code on the next line)
There was a problem hiding this comment.
would be really nice to have a guide for this...
There was a problem hiding this comment.
@edsadr it would be great to have it documented, I'm not sure where, maybe in the test-writing guide for now? I think the easiest way to get started would be to raise a PR with whatever you think it should be, @mention nodejs/collaborators, and see what the consensus is.
There was a problem hiding this comment.
@gibfahn thanks, I think is worth it to have a basic one and will work in something like that for a PR
* validate the errors for assert.throws * use arrow functions
b659719 to
edbcd43
Compare
|
@cjihrig changed the RegExp now 🙂 |
|
Landed c963094 |
* validate the errors for assert.throws * use arrow functions PR-URL: #10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: nodejs#10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: nodejs#10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: nodejs#10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: nodejs#10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: #10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: #10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: #10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* validate the errors for assert.throws * use arrow functions PR-URL: #10714 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test