Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9e1f736

Browse filesBrowse files
jasnelltargos
authored andcommitted
test: minor refactor in common/index.js
PR-URL: #22738 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: George Adams <george.adams@uk.ibm.com>
1 parent e2b72c2 commit 9e1f736
Copy full SHA for 9e1f736

File tree

Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed
Open diff view settings
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,14 @@ const PIPE = (() => {
143143
return path.join(pipePrefix, pipeName);
144144
})();
145145

146-
let hasIPv6;
147-
{
146+
const hasIPv6 = (() => {
148147
const iFaces = os.networkInterfaces();
149148
const re = isWindows ? /Loopback Pseudo-Interface/ : /lo/;
150-
hasIPv6 = Object.keys(iFaces).some(function(name) {
151-
return re.test(name) && iFaces[name].some(function(info) {
152-
return info.family === 'IPv6';
153-
});
149+
return Object.keys(iFaces).some((name) => {
150+
return re.test(name) &&
151+
iFaces[name].some(({ family }) => family === 'IPv6');
154152
});
155-
}
153+
})();
156154

157155
/*
158156
* Check that when running a test with

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.