js-libp2p/test/content-routing/dht/configuration.node.ts
Alex Potsides c64a586a20
chore: update aegir to the latest version (#1186)
Removes boilerplate config that is no longer necessary
2022-04-09 09:26:25 +01:00

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()
})
})