-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
test: refactor structure of common/index #22511
Conversation
@nodejs/testing |
test/common/index.js
Outdated
get localhostIPv4() { | ||
if (localhostIPv4 !== null) return localhostIPv4; | ||
|
||
if (exports.inFreeBSDJail) { |
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.
Nit: s/exports/this/
test/common/index.js
Outdated
|
||
let PIPE; |
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.
Suggestion, use IIFE:
const PIPE = (() => {
const localRelative = path.relative(process.cwd(), `${tmpdir.path}/`);
const pipePrefix = isWindows ? '\\\\.\\pipe\\' : localRelative;
const pipeName = `node-test.${process.pid}.sock`;
return path.join(pipePrefix, pipeName);
})()
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.
😍
+10 for readability, and style conformance. |
3c7b47f
to
a38522d
Compare
@jasnell This needs a rebase, sorry :/ |
Ping @jasnell |
Haven't forgotten. I've just been moving ;-) ... will be finishing this up today. |
e82face
to
dca6d29
Compare
CI after rebase: https://ci.nodejs.org/job/node-test-pull-request/17033/ |
PR-URL: #22511 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Landed in 286ca2c |
PR-URL: #22511 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #22511 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #22511 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Further work on restructuring
common/index.js
. This updates to themodule.exports = {}
structure so that it's easier to see what exactly is being exported. Part of an ongoing effort to incrementally de-monolith-ize the thing.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes