mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-26 07:21:36 +00:00
swarm: Fix self.handles data structure
This commit is contained in:
@ -73,6 +73,18 @@ experiment('BASICS', function () {
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
experiment('Swarm.registerHandler', function () {
|
||||
test('throws when registering a protcol handler twice', function (done) {
|
||||
var swarm = new Swarm()
|
||||
swarm.registerHandler('/sparkles/1.1.1', function () {})
|
||||
swarm.registerHandler('/sparkles/1.1.1', function (err) {
|
||||
expect(err).to.be.an.instanceOf(Error)
|
||||
expect(err.message).to.be.equal('Handle for protocol already exists')
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
experiment('BASE', function () {
|
||||
|
Reference in New Issue
Block a user