mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-13 12:46:04 +00:00
28 lines
691 B
TypeScript
28 lines
691 B
TypeScript
/* eslint-env mocha */
|
|
|
|
import { expect } from 'aegir/chai'
|
|
import { createLibp2p, Libp2p } from '../../../src/index.js'
|
|
import { createSubsystemOptions } from './utils.js'
|
|
|
|
describe('DHT subsystem is configurable', () => {
|
|
let libp2p: Libp2p
|
|
|
|
afterEach(async () => {
|
|
if (libp2p != null) {
|
|
await libp2p.stop()
|
|
}
|
|
})
|
|
|
|
it('should not exist if no module is provided', async () => {
|
|
libp2p = await createLibp2p(createSubsystemOptions({
|
|
dht: undefined
|
|
}))
|
|
expect(libp2p.dht).to.not.exist()
|
|
})
|
|
|
|
it('should exist if the module is provided', async () => {
|
|
libp2p = await createLibp2p(createSubsystemOptions())
|
|
expect(libp2p.dht).to.exist()
|
|
})
|
|
})
|