mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-16 07:30:51 +00:00
* test: remove all tests for a clean slate The refactor will require a large number of updates to the tests. In order to ensure we have done a decent deduplication, and have a cleaner suite of tests we've removed all tests. This will also allow us to more easily see tests for the refactored systems. We have a record of the latest test suites in master, so we are not losing any history. * chore: update tcp and websockets * chore: remove other transports until they are converted * chore: use mafmt and multiaddr async versions * chore: add and fix dependencies * chore: clean up travis file * feat: add new transport manager * docs: add constructor jsdocs * refactor(config): check that transports exist This also removes the other logic, it can be added when those subsystems are refactored * chore(deps): use async peer-id and peer-info * feat: wire up the transport manager with libp2p * chore: remove superstruct dep
30 lines
639 B
JavaScript
30 lines
639 B
JavaScript
'use strict'
|
|
|
|
const TransportManager = require('./src/transport-manager')
|
|
const mockUpgrader = require('./test/utils/mockUpgrader')
|
|
const { MULTIADDRS_WEBSOCKETS } = require('./test/fixtures/browser')
|
|
let tm
|
|
|
|
const WebSockets = require('libp2p-websockets')
|
|
|
|
const before = async () => {
|
|
tm = new TransportManager({
|
|
upgrader: mockUpgrader,
|
|
onConnection: () => {}
|
|
})
|
|
tm.add(WebSockets.prototype[Symbol.toStringTag], WebSockets)
|
|
await tm.listen(MULTIADDRS_WEBSOCKETS)
|
|
}
|
|
|
|
const after = async () => {
|
|
await tm.close()
|
|
}
|
|
|
|
module.exports = {
|
|
bundlesize: { maxSize: '220kB' },
|
|
hooks: {
|
|
pre: before,
|
|
post: after
|
|
}
|
|
}
|