From 02e07993dae2d03261f091b820bb609697749679 Mon Sep 17 00:00:00 2001 From: David Dias Date: Thu, 30 Jul 2015 14:58:32 -0700 Subject: [PATCH] add/update lastSeen to a peer once a stream is open --- tests/swarm-test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/swarm-test.js b/tests/swarm-test.js index f3f3d489..646f0545 100644 --- a/tests/swarm-test.js +++ b/tests/swarm-test.js @@ -72,6 +72,18 @@ experiment('BASE', function () { }) }) }) + test('Check for lastSeen', function (done) { + var protocol = '/sparkles/3.3.3' + + swarmB.registerHandler(protocol, function (stream) {}) + + swarmA.openStream(peerB, protocol, function (err, stream) { + expect(err).to.not.be.instanceof(Error) + expect(peerB.lastSeen).to.be.instanceof(Date) + done() + }) + }) + }) experiment('IDENTIFY', function () {