Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
feat: return the multiaddr in isConnected - usefulness
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 31, 2017
1 parent 2d1f86c commit a0a06d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PeerInfo {
}

isConnected () {
return Boolean(this._connectedMultiaddr)
return this._connectedMultiaddr
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ describe('peer-info', () => {
it('.connect .disconnect', () => {
pi.multiaddrs.add('/ip4/127.0.0.1/tcp/5001')
pi.connect('/ip4/127.0.0.1/tcp/5001')
expect(pi.isConnected()).to.equal(true)
expect(pi.isConnected()).to.exist()
pi.disconnect()
expect(pi.isConnected()).to.equal(false)
expect(pi.isConnected()).to.not.exist()
expect(() => pi.connect('/ip4/127.0.0.1/tcp/5001/ws')).to.throw()
})

Expand Down

0 comments on commit a0a06d1

Please sign in to comment.