Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Aug 24, 2018

Further work on restructuring common/index.js. This updates to the module.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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Aug 24, 2018
@jasnell
Copy link
Member Author

jasnell commented Aug 24, 2018

@Trott
Copy link
Member

Trott commented Aug 24, 2018

@nodejs/testing

get localhostIPv4() {
if (localhostIPv4 !== null) return localhostIPv4;

if (exports.inFreeBSDJail) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: s/exports/this/


let PIPE;
Copy link
Contributor

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);
})()

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@refack
Copy link
Contributor

refack commented Aug 25, 2018

+10 for readability, and style conformance.

@jasnell jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 27, 2018
@jasnell jasnell force-pushed the test-refactor-index branch from 3c7b47f to a38522d Compare August 27, 2018 21:15
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 27, 2018
@addaleax
Copy link
Member

@jasnell This needs a rebase, sorry :/

@BridgeAR
Copy link
Member

BridgeAR commented Sep 5, 2018

Ping @jasnell

@jasnell
Copy link
Member Author

jasnell commented Sep 5, 2018

Haven't forgotten. I've just been moving ;-) ... will be finishing this up today.

@jasnell jasnell force-pushed the test-refactor-index branch from e82face to dca6d29 Compare September 5, 2018 18:25
@jasnell
Copy link
Member Author

jasnell commented Sep 5, 2018

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 5, 2018
@jasnell jasnell assigned andrasq and unassigned andrasq Sep 5, 2018
jasnell added a commit that referenced this pull request Sep 5, 2018
PR-URL: #22511
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@jasnell
Copy link
Member Author

jasnell commented Sep 5, 2018

Landed in 286ca2c

@jasnell jasnell closed this Sep 5, 2018
targos pushed a commit that referenced this pull request Sep 12, 2018
PR-URL: #22511
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Sep 19, 2018
PR-URL: #22511
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Sep 20, 2018
PR-URL: #22511
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants