test: reuse same test code for Websockets, remove code duplication
test: reuse same test code for Websockets, remove code duplication

diasdavid/js-libp2p-swarm,diasdavid/node-ipfs-swarm,libp2p/js-libp2p-swarm,diasdavid/node-libp2p-swarm