mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-22 13:31:32 +00:00
fix: not started yet (#297)
* fix: callback when not started rather than throwing asserts * fix: dont remove transports until the switch has stopped * test: update connection check logic * test: fix variable reference * chore: update switch dep * chore: update switch dep
This commit is contained in:
@ -114,5 +114,29 @@ describe('libp2p state machine (fsm)', () => {
|
||||
|
||||
node.start()
|
||||
})
|
||||
|
||||
it('should not dial when the node is stopped', (done) => {
|
||||
node.on('stop', () => {
|
||||
node.dial(null, (err) => {
|
||||
expect(err).to.exist()
|
||||
expect(err.code).to.eql('ERR_NODE_NOT_STARTED')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
node.stop()
|
||||
})
|
||||
|
||||
it('should not dial (fsm) when the node is stopped', (done) => {
|
||||
node.on('stop', () => {
|
||||
node.dialFSM(null, null, (err) => {
|
||||
expect(err).to.exist()
|
||||
expect(err.code).to.eql('ERR_NODE_NOT_STARTED')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
node.stop()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user