From b16b360ae86cfe91ccc98eda26b9c26be094e7d9 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 30 Jan 2016 21:20:37 -0800 Subject: [PATCH] test: fix var redeclarations in test-os MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/4990 Reviewed-By: Michaël Zasso Reviewed-By: Roman Klauke Reviewed-By: Johan Bergström Reviewed-By: James M Snell --- test/parallel/test-os.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index f7fe4634c40dca..15fd189f9be20e 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -13,7 +13,7 @@ if (common.isWindows) { process.env.TEMP = ''; assert.equal(os.tmpdir(), '/tmp'); process.env.TMP = ''; - var expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; + const expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; assert.equal(os.tmpdir(), expected); process.env.TEMP = '\\temp\\'; assert.equal(os.tmpdir(), '\\temp'); @@ -83,21 +83,25 @@ var interfaces = os.networkInterfaces(); console.error(interfaces); switch (platform) { case 'linux': - var filter = function(e) { return e.address == '127.0.0.1'; }; - var actual = interfaces.lo.filter(filter); - var expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', - mac: '00:00:00:00:00:00', family: 'IPv4', - internal: true }]; - assert.deepEqual(actual, expected); - break; + { + const filter = function(e) { return e.address == '127.0.0.1'; }; + const actual = interfaces.lo.filter(filter); + const expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', + mac: '00:00:00:00:00:00', family: 'IPv4', + internal: true }]; + assert.deepEqual(actual, expected); + break; + } case 'win32': - var filter = function(e) { return e.address == '127.0.0.1'; }; - var actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter); - var expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', - mac: '00:00:00:00:00:00', family: 'IPv4', - internal: true }]; - assert.deepEqual(actual, expected); - break; + { + const filter = function(e) { return e.address == '127.0.0.1'; }; + const actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter); + const expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', + mac: '00:00:00:00:00:00', family: 'IPv4', + internal: true }]; + assert.deepEqual(actual, expected); + break; + } } var EOL = os.EOL;