mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-04-25 23:32:36 +00:00
chore: update aegir
This commit is contained in:
parent
39ef6fc809
commit
1f86c9f7e2
@ -36,17 +36,18 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/libp2p/js-libp2p-websockets#readme",
|
"homepage": "https://github.com/libp2p/js-libp2p-websockets#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"interface-connection": "~0.3.0",
|
"interface-connection": "~0.3.2",
|
||||||
"lodash.includes": "^4.3.0",
|
"lodash.includes": "^4.3.0",
|
||||||
"mafmt": "^2.1.6",
|
"mafmt": "^2.1.6",
|
||||||
"pull-ws": "^3.2.8"
|
"pull-ws": "^3.2.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"aegir": "^10.0.0",
|
"aegir": "^11.0.0",
|
||||||
"chai": "^3.5.0",
|
"chai": "^3.5.0",
|
||||||
|
"dirty-chai": "^1.2.2",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"interface-transport": "~0.3.3",
|
"interface-transport": "~0.3.5",
|
||||||
"multiaddr": "^2.2.1",
|
"multiaddr": "^2.2.2",
|
||||||
"pre-commit": "^1.2.2",
|
"pre-commit": "^1.2.2",
|
||||||
"pull-goodbye": "0.0.1",
|
"pull-goodbye": "0.0.1",
|
||||||
"pull-stream": "^3.5.0"
|
"pull-stream": "^3.5.0"
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
/* eslint-env mocha */
|
/* eslint-env mocha */
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const expect = require('chai').expect
|
const chai = require('chai')
|
||||||
|
const dirtyChai = require('dirty-chai')
|
||||||
|
const expect = chai.expect
|
||||||
|
chai.use(dirtyChai)
|
||||||
|
|
||||||
const multiaddr = require('multiaddr')
|
const multiaddr = require('multiaddr')
|
||||||
const pull = require('pull-stream')
|
const pull = require('pull-stream')
|
||||||
const goodbye = require('pull-goodbye')
|
const goodbye = require('pull-goodbye')
|
||||||
@ -15,7 +19,7 @@ describe('libp2p-websockets', () => {
|
|||||||
|
|
||||||
beforeEach((done) => {
|
beforeEach((done) => {
|
||||||
ws = new WS()
|
ws = new WS()
|
||||||
expect(ws).to.exist
|
expect(ws).to.exist()
|
||||||
conn = ws.dial(ma, done)
|
conn = ws.dial(ma, done)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -25,7 +29,7 @@ describe('libp2p-websockets', () => {
|
|||||||
const s = goodbye({
|
const s = goodbye({
|
||||||
source: pull.values([message]),
|
source: pull.values([message]),
|
||||||
sink: pull.collect((err, results) => {
|
sink: pull.collect((err, results) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
expect(results).to.be.eql([message])
|
expect(results).to.be.eql([message])
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
@ -41,7 +45,7 @@ describe('libp2p-websockets', () => {
|
|||||||
const s = goodbye({
|
const s = goodbye({
|
||||||
source: pull.values([rawMessage]),
|
source: pull.values([rawMessage]),
|
||||||
sink: pull.collect((err, results) => {
|
sink: pull.collect((err, results) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
expect(results).to.be.eql([rawMessage])
|
expect(results).to.be.eql([rawMessage])
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
@ -57,7 +61,7 @@ describe('libp2p-websockets', () => {
|
|||||||
pull.map((val) => Buffer(val.toString()))
|
pull.map((val) => Buffer(val.toString()))
|
||||||
),
|
),
|
||||||
sink: pull.collect((err, result) => {
|
sink: pull.collect((err, result) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
expect(result).to.have.length(1000)
|
expect(result).to.have.length(1000)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
33
test/node.js
33
test/node.js
@ -1,7 +1,10 @@
|
|||||||
/* eslint-env mocha */
|
/* eslint-env mocha */
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const expect = require('chai').expect
|
const chai = require('chai')
|
||||||
|
const dirtyChai = require('dirty-chai')
|
||||||
|
const expect = chai.expect
|
||||||
|
chai.use(dirtyChai)
|
||||||
const multiaddr = require('multiaddr')
|
const multiaddr = require('multiaddr')
|
||||||
const pull = require('pull-stream')
|
const pull = require('pull-stream')
|
||||||
const goodbye = require('pull-goodbye')
|
const goodbye = require('pull-goodbye')
|
||||||
@ -13,7 +16,7 @@ require('./compliance.node')
|
|||||||
describe('instantiate the transport', () => {
|
describe('instantiate the transport', () => {
|
||||||
it('create', () => {
|
it('create', () => {
|
||||||
const ws = new WS()
|
const ws = new WS()
|
||||||
expect(ws).to.exist
|
expect(ws).to.exist()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -77,7 +80,7 @@ describe('listen', () => {
|
|||||||
const listener = ws.createListener((conn) => {})
|
const listener = ws.createListener((conn) => {})
|
||||||
listener.listen(ma, () => {
|
listener.listen(ma, () => {
|
||||||
listener.getAddrs((err, addrs) => {
|
listener.getAddrs((err, addrs) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
expect(addrs.length).to.equal(1)
|
expect(addrs.length).to.equal(1)
|
||||||
expect(addrs[0]).to.deep.equal(ma)
|
expect(addrs[0]).to.deep.equal(ma)
|
||||||
listener.close(done)
|
listener.close(done)
|
||||||
@ -103,7 +106,7 @@ describe('listen', () => {
|
|||||||
const listener = ws.createListener((conn) => {})
|
const listener = ws.createListener((conn) => {})
|
||||||
listener.listen(ma, () => {
|
listener.listen(ma, () => {
|
||||||
listener.getAddrs((err, addrs) => {
|
listener.getAddrs((err, addrs) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
expect(addrs.length).to.equal(1)
|
expect(addrs.length).to.equal(1)
|
||||||
expect(addrs[0]).to.deep.equal(ma)
|
expect(addrs[0]).to.deep.equal(ma)
|
||||||
listener.close(done)
|
listener.close(done)
|
||||||
@ -135,7 +138,7 @@ describe('dial', () => {
|
|||||||
const s = goodbye({
|
const s = goodbye({
|
||||||
source: pull.values(['hey']),
|
source: pull.values(['hey']),
|
||||||
sink: pull.collect((err, result) => {
|
sink: pull.collect((err, result) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
|
|
||||||
expect(result).to.be.eql(['hey'])
|
expect(result).to.be.eql(['hey'])
|
||||||
done()
|
done()
|
||||||
@ -156,7 +159,7 @@ describe('dial', () => {
|
|||||||
const s = goodbye({
|
const s = goodbye({
|
||||||
source: pull.values(['hey']),
|
source: pull.values(['hey']),
|
||||||
sink: pull.collect((err, result) => {
|
sink: pull.collect((err, result) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
|
|
||||||
expect(result).to.be.eql(['hey'])
|
expect(result).to.be.eql(['hey'])
|
||||||
done()
|
done()
|
||||||
@ -207,10 +210,10 @@ describe('valid Connection', () => {
|
|||||||
const ws = new WS()
|
const ws = new WS()
|
||||||
|
|
||||||
const listener = ws.createListener((conn) => {
|
const listener = ws.createListener((conn) => {
|
||||||
expect(conn).to.exist
|
expect(conn).to.exist()
|
||||||
|
|
||||||
conn.getObservedAddrs((err, addrs) => {
|
conn.getObservedAddrs((err, addrs) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
dialerObsAddrs = addrs
|
dialerObsAddrs = addrs
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -228,7 +231,7 @@ describe('valid Connection', () => {
|
|||||||
|
|
||||||
function onEnd () {
|
function onEnd () {
|
||||||
conn.getObservedAddrs((err, addrs) => {
|
conn.getObservedAddrs((err, addrs) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
listenerObsAddrs = addrs
|
listenerObsAddrs = addrs
|
||||||
|
|
||||||
listener.close(onClose)
|
listener.close(onClose)
|
||||||
@ -246,10 +249,10 @@ describe('valid Connection', () => {
|
|||||||
const ws = new WS()
|
const ws = new WS()
|
||||||
|
|
||||||
const listener = ws.createListener((conn) => {
|
const listener = ws.createListener((conn) => {
|
||||||
expect(conn).to.exist
|
expect(conn).to.exist()
|
||||||
|
|
||||||
conn.getPeerInfo((err, peerInfo) => {
|
conn.getPeerInfo((err, peerInfo) => {
|
||||||
expect(err).to.exist
|
expect(err).to.exist()
|
||||||
})
|
})
|
||||||
|
|
||||||
pull(conn, conn)
|
pull(conn, conn)
|
||||||
@ -266,7 +269,7 @@ describe('valid Connection', () => {
|
|||||||
|
|
||||||
function onEnd () {
|
function onEnd () {
|
||||||
conn.getPeerInfo((err, peerInfo) => {
|
conn.getPeerInfo((err, peerInfo) => {
|
||||||
expect(err).to.exit
|
expect(err).to.exist()
|
||||||
listener.close(done)
|
listener.close(done)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -277,11 +280,11 @@ describe('valid Connection', () => {
|
|||||||
const ws = new WS()
|
const ws = new WS()
|
||||||
|
|
||||||
const listener = ws.createListener((conn) => {
|
const listener = ws.createListener((conn) => {
|
||||||
expect(conn).to.exist
|
expect(conn).to.exist()
|
||||||
conn.setPeerInfo('a')
|
conn.setPeerInfo('a')
|
||||||
|
|
||||||
conn.getPeerInfo((err, peerInfo) => {
|
conn.getPeerInfo((err, peerInfo) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
expect(peerInfo).to.equal('a')
|
expect(peerInfo).to.equal('a')
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -301,7 +304,7 @@ describe('valid Connection', () => {
|
|||||||
|
|
||||||
function onEnd () {
|
function onEnd () {
|
||||||
conn.getPeerInfo((err, peerInfo) => {
|
conn.getPeerInfo((err, peerInfo) => {
|
||||||
expect(err).to.not.exist
|
expect(err).to.not.exist()
|
||||||
expect(peerInfo).to.equal('b')
|
expect(peerInfo).to.equal('b')
|
||||||
listener.close(done)
|
listener.close(done)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user