Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

feat/add-ping-and-test #42

Merged
merged 2 commits into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"url": "https://github.com/ipfs/js-libp2p-ipfs-nodejs/issues"
},
"engines": {
"node": ">=4.0.0"
"node": ">=4.0.0",
"npm": ">=3.0.0"
},
"homepage": "https://github.com/ipfs/js-libp2p-ipfs-nodejs#readme",
"devDependencies": {
Expand All @@ -40,7 +41,7 @@
"pull-stream": "^3.5.0"
},
"dependencies": {
"libp2p": "^0.3.0",
"libp2p": "^0.3.1",
"libp2p-secio": "^0.6.3",
"libp2p-spdy": "^0.10.0",
"libp2p-swarm": "^0.26.3",
Expand All @@ -61,4 +62,4 @@
"Stephen Whitmore <[email protected]>",
"varunagarwal315 <[email protected]>"
]
}
}
11 changes: 11 additions & 0 deletions test/libp2p.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,17 @@ describe('libp2p-ipfs-nodejs', () => {
})
})

it('nodeE ping to nodeF', (done) => {
nodeE.pingByPeerInfo(nodeF.peerInfo, (err, ping) => {
expect(err).to.not.exist
ping.once('ping', (time) => {
expect(time).to.be.above(1)
ping.stop()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe assert the time to be > 0 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

done()
})
})
})

it('crash that node, make sure nodeA continues going steady', (done) => {
spawnedNode.kill('SIGKILL')

Expand Down