Skip to content

Commit

Permalink
Update libp2p-websockets and add test for callback's conn
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaiodias committed Mar 20, 2016
1 parent 9d149ca commit f2df558
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"istanbul": "^0.4.2",
"libp2p-spdy": "^0.2.3",
"libp2p-tcp": "^0.4.0",
"libp2p-websockets": "^0.2.0",
"libp2p-websockets": "^0.2.1",
"mocha": "^2.4.5",
"multiaddr": "^1.3.0",
"peer-id": "^0.6.0",
Expand Down
13 changes: 13 additions & 0 deletions tests/swarm-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,19 @@ describe('transport - websockets', function () {
conn.end()
})

it('dial (conn from callback)', (done) => {
swarmA.transport.dial('ws', multiaddr('/ip4/127.0.0.1/tcp/9999/websockets'), (err, conn) => {
expect(err).to.not.exist

conn.pipe(bl((err, data) => {
expect(err).to.not.exist
done()
}))
conn.write('hey')
conn.end()
})
})

it('close', (done) => {
var count = 0
swarmA.transport.close('ws', closed)
Expand Down

0 comments on commit f2df558

Please sign in to comment.