Skip to content

Commit

Permalink
test: minor refactor in common/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Sep 6, 2018
1 parent 0c30d0e commit 2981827
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,14 @@ const PIPE = (() => {
return path.join(pipePrefix, pipeName);
})();

let hasIPv6;
{
const hasIPv6 = (() => {
const iFaces = os.networkInterfaces();
const re = isWindows ? /Loopback Pseudo-Interface/ : /lo/;
hasIPv6 = Object.keys(iFaces).some(function(name) {
return re.test(name) && iFaces[name].some(function(info) {
return info.family === 'IPv6';
});
return Object.keys(iFaces).some((name) => {
return re.test(name) &&
iFaces[name].some(({ family }) => family === 'IPv6');
});
}
})();

/*
* Check that when running a test with
Expand Down

0 comments on commit 2981827

Please sign in to comment.