mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-24 21:22:33 +00:00
35 lines
817 B
JavaScript
35 lines
817 B
JavaScript
/* eslint-env mocha */
|
|
'use strict'
|
|
|
|
module.exports = (common) => {
|
|
describe('interface-peer-discovery', () => {
|
|
let discovery
|
|
|
|
before(async () => {
|
|
discovery = await common.setup()
|
|
})
|
|
|
|
after(() => common.teardown && common.teardown())
|
|
|
|
afterEach('ensure discovery was stopped', () => discovery.stop())
|
|
|
|
it('can start the service', async () => {
|
|
await discovery.start()
|
|
})
|
|
|
|
it('can start and stop the service', async () => {
|
|
await discovery.start()
|
|
await discovery.stop()
|
|
})
|
|
|
|
it('should not fail to stop the service if it was not started', async () => {
|
|
await discovery.stop()
|
|
})
|
|
|
|
it('should not fail to start the service if it is already started', async () => {
|
|
await discovery.start()
|
|
await discovery.start()
|
|
})
|
|
})
|
|
}
|