test: fix require nits in some test-tls-* tests#14008
test: fix require nits in some test-tls-* tests#14008vsemozhetbyt wants to merge 1 commit intonodejs:masterfrom vsemozhetbyt:test-tls
Conversation
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/8900/ All fails seem unrelated. |
| const tls = require('tls'); | ||
|
|
||
| const assert = require('assert'); | ||
| const { spawn } = require('child_process'); |
There was a problem hiding this comment.
At the moment, the test writing guide says:
The require statements are sorted in ASCII order (digits, upper case, _, lower case).
It's not clear to me if this refers to the variable names or the module names. Thoughts?
There was a problem hiding this comment.
@sam-github? Ref: 02b9270
Since the whole paragraph's subject is modules, my intuition says sort by module name.
(also congruent with Jewish law that states you bless food according to the main ingredient and not by how you eat it 😉)
There was a problem hiding this comment.
FWIW, I think module name sorting would be more consistent here, as we can use many variable names in destructuring and only one module name. See examples.
|
|
Pre-land CI: https://ci.nodejs.org/job/node-test-pull-request/8967/ |
|
Landed in cc1a47d |
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names. PR-URL: #14008 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names. PR-URL: #14008 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names. PR-URL: #14008 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names. PR-URL: #14008 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names. PR-URL: #14008 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names. PR-URL: #14008 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Do not require if test is skipped. * Do not re-require without need. * Sort requiring by module names. PR-URL: #14008 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test
requireif test is skipped.requirewithout need.I've just stumble upon these nits in these connected tests by chance. Maybe I shall try to fix this class of nits in tests more thoroughly later if this makes any sense.