fix: allow switch to be configured (#354)

This commit is contained in:
Jacob Heun
2019-04-12 11:10:09 +02:00
committed by GitHub
parent 4cb541ddae
commit eb5aa03232
2 changed files with 28 additions and 0 deletions

View File

@ -170,6 +170,33 @@ describe('configuration', () => {
expect(validateConfig(options)).to.deep.equal(expected)
})
it('should allow for configuring the switch', () => {
const options = {
peerInfo,
switch: {
blacklistTTL: 60e3,
blackListAttempts: 5,
maxParallelDials: 100,
maxColdCalls: 50,
dialTimeout: 30e3
},
modules: {
transport: [ WS ],
peerDiscovery: [ ]
}
}
expect(validateConfig(options)).to.deep.include({
switch: {
blacklistTTL: 60e3,
blackListAttempts: 5,
maxParallelDials: 100,
maxColdCalls: 50,
dialTimeout: 30e3
}
})
})
it('should allow for delegated content and peer routing', () => {
const peerRouter = new DelegatedPeerRouter()
const contentRouter = new DelegatedContentRouter(peerInfo)