From 14d3578eafbc9a267e8b8c11f2359891e2544a6f Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 19 Feb 2018 09:45:57 +0000 Subject: [PATCH] test: update tests to use libp2p-mplex module --- test/stream-muxing.node.js | 20 ++++++++++---------- test/transports.browser.js | 6 +++--- test/utils/bundle.browser.js | 8 ++++---- test/utils/bundle.node.js | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/stream-muxing.node.js b/test/stream-muxing.node.js index 9ef91a80..c887aa71 100644 --- a/test/stream-muxing.node.js +++ b/test/stream-muxing.node.js @@ -60,14 +60,14 @@ describe('stream muxing', () => { ], done) }) - it('multiplex only', (done) => { + it('mplex only', (done) => { let nodeA let nodeB function setup (callback) { parallel([ (cb) => createNode('/ip4/0.0.0.0/tcp/0', { - muxer: ['multiplex'] + muxer: ['mplex'] }, (err, node) => { expect(err).to.not.exist() nodeA = node @@ -75,7 +75,7 @@ describe('stream muxing', () => { node.start(cb) }), (cb) => createNode('/ip4/0.0.0.0/tcp/0', { - muxer: ['multiplex'] + muxer: ['mplex'] }, (err, node) => { expect(err).to.not.exist() nodeB = node @@ -92,7 +92,7 @@ describe('stream muxing', () => { ], done) }) - it('spdy + multiplex', function (done) { + it('spdy + mplex', function (done) { this.timeout(5000) let nodeA @@ -101,7 +101,7 @@ describe('stream muxing', () => { function setup (callback) { parallel([ (cb) => createNode('/ip4/0.0.0.0/tcp/0', { - muxer: ['spdy', 'multiplex'] + muxer: ['spdy', 'mplex'] }, (err, node) => { expect(err).to.not.exist() nodeA = node @@ -109,7 +109,7 @@ describe('stream muxing', () => { node.start(cb) }), (cb) => createNode('/ip4/0.0.0.0/tcp/0', { - muxer: ['spdy', 'multiplex'] + muxer: ['spdy', 'mplex'] }, (err, node) => { expect(err).to.not.exist() nodeB = node @@ -126,7 +126,7 @@ describe('stream muxing', () => { ], done) }) - it('spdy + multiplex switched order', function (done) { + it('spdy + mplex switched order', function (done) { this.timeout(5 * 1000) let nodeA @@ -135,7 +135,7 @@ describe('stream muxing', () => { function setup (callback) { parallel([ (cb) => createNode('/ip4/0.0.0.0/tcp/0', { - muxer: ['spdy', 'multiplex'] + muxer: ['spdy', 'mplex'] }, (err, node) => { expect(err).to.not.exist() nodeA = node @@ -143,7 +143,7 @@ describe('stream muxing', () => { node.start(cb) }), (cb) => createNode('/ip4/0.0.0.0/tcp/0', { - muxer: ['multiplex', 'spdy'] + muxer: ['mplex', 'spdy'] }, (err, node) => { expect(err).to.not.exist() nodeB = node @@ -177,7 +177,7 @@ describe('stream muxing', () => { node.start(cb) }), (cb) => createNode('/ip4/0.0.0.0/tcp/0', { - muxer: ['multiplex'] + muxer: ['mplex'] }, (err, node) => { expect(err).to.not.exist() nodeB = node diff --git a/test/transports.browser.js b/test/transports.browser.js index 89aaf8dd..50f7b60c 100644 --- a/test/transports.browser.js +++ b/test/transports.browser.js @@ -48,12 +48,12 @@ describe('transports', () => { }) }) - it('create libp2pNode with multiplex only', (done) => { + it('create libp2pNode with mplex only', (done) => { PeerInfo.create((err, peerInfo) => { expect(err).to.not.exist() - const b = new Node(peerInfo, null, { muxer: ['multiplex'] }) - expect(b.modules.connection.muxer).to.eql([require('libp2p-multiplex')]) + const b = new Node(peerInfo, null, { muxer: ['mplex'] }) + expect(b.modules.connection.muxer).to.eql([require('libp2p-mplex')]) done() }) }) diff --git a/test/utils/bundle.browser.js b/test/utils/bundle.browser.js index 4ed9740a..5e26f866 100644 --- a/test/utils/bundle.browser.js +++ b/test/utils/bundle.browser.js @@ -4,7 +4,7 @@ const WS = require('libp2p-websockets') const WebRTCStar = require('libp2p-webrtc-star') const WebSocketStar = require('libp2p-websocket-star') const spdy = require('libp2p-spdy') -const multiplex = require('libp2p-multiplex') +const mplex = require('libp2p-mplex') const secio = require('libp2p-secio') const Railing = require('libp2p-railing') const libp2p = require('../..') @@ -17,8 +17,8 @@ function mapMuxers (list) { switch (pref.trim().toLowerCase()) { case 'spdy': return spdy - case 'multiplex': - return multiplex + case 'mplex': + return mplex default: throw new Error(pref + ' muxer not available') } @@ -29,7 +29,7 @@ function getMuxers (options) { if (options) { return mapMuxers(options) } else { - return [multiplex, spdy] + return [mplex, spdy] } } diff --git a/test/utils/bundle.node.js b/test/utils/bundle.node.js index 5d670752..061377f3 100644 --- a/test/utils/bundle.node.js +++ b/test/utils/bundle.node.js @@ -6,7 +6,7 @@ const WS = require('libp2p-websockets') const Railing = require('libp2p-railing') const spdy = require('libp2p-spdy') const KadDHT = require('libp2p-kad-dht') -const multiplex = require('libp2p-multiplex') +const mplex = require('libp2p-mplex') const secio = require('libp2p-secio') const libp2p = require('../..') @@ -17,7 +17,7 @@ function mapMuxers (list) { } switch (pref.trim().toLowerCase()) { case 'spdy': return spdy - case 'multiplex': return multiplex + case 'mplex': return mplex default: throw new Error(pref + ' muxer not available') } @@ -31,7 +31,7 @@ function getMuxers (muxers) { } else if (muxers) { return mapMuxers(muxers) } else { - return [multiplex, spdy] + return [mplex, spdy] } }