From 13ace4fcea4cc36bd3a6004fc21ccdac4b1f537e Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Thu, 4 Aug 2016 19:09:28 +0200 Subject: [PATCH 1/2] chore(package): update dependencies https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d47a23..53c4ed9 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "simple-websocket-server": "^0.1.4" }, "devDependencies": { - "aegir": "^4.0.0", + "aegir": "^6.0.0", "multiaddr": "^2.0.2", "chai": "^3.5.0", "gulp": "^3.9.1", From 33f5fb300b5c267616c5d3533723a3e572b439b8 Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 29 Aug 2016 16:40:03 +0100 Subject: [PATCH 2/2] fix(style): reduce nested callbacks --- test/node.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/test/node.js b/test/node.js index 6b7fd88..655721f 100644 --- a/test/node.js +++ b/test/node.js @@ -210,18 +210,22 @@ describe('valid Connection', () => { listener.listen(ma, () => { const conn = ws.dial(ma) - conn.on('end', () => { + conn.on('end', onEnd) + + function onEnd () { conn.getObservedAddrs((err, addrs) => { expect(err).to.not.exist listenerObsAddrs = addrs - listener.close(() => { + listener.close(onClose) + + function onClose () { expect(listenerObsAddrs[0]).to.deep.equal(ma) expect(dialerObsAddrs.length).to.equal(0) done() - }) + } }) - }) + } conn.resume() conn.end() }) @@ -243,12 +247,14 @@ describe('valid Connection', () => { listener.listen(ma, () => { const conn = ws.dial(ma) - conn.on('end', () => { + conn.on('end', onEnd) + + function onEnd () { conn.getPeerInfo((err, peerInfo) => { expect(err).to.exit listener.close(done) }) - }) + } conn.resume() conn.end() }) @@ -269,7 +275,8 @@ describe('valid Connection', () => { conn.pipe(conn) }) - listener.listen(ma, () => { + listener.listen(ma, onListen) + function onListen () { const conn = ws.dial(ma) conn.setPeerInfo('b') @@ -282,7 +289,7 @@ describe('valid Connection', () => { }) conn.resume() conn.end() - }) + } }) })