-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Landed in 286ca2c |
PR-URL: #22511 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #22511 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #22511 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
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