mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-06-12 13:51:26 +00:00
chore: update aegir
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
/* eslint-env mocha */
|
||||
'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 pull = require('pull-stream')
|
||||
const goodbye = require('pull-goodbye')
|
||||
@ -15,7 +19,7 @@ describe('libp2p-websockets', () => {
|
||||
|
||||
beforeEach((done) => {
|
||||
ws = new WS()
|
||||
expect(ws).to.exist
|
||||
expect(ws).to.exist()
|
||||
conn = ws.dial(ma, done)
|
||||
})
|
||||
|
||||
@ -25,7 +29,7 @@ describe('libp2p-websockets', () => {
|
||||
const s = goodbye({
|
||||
source: pull.values([message]),
|
||||
sink: pull.collect((err, results) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
expect(results).to.be.eql([message])
|
||||
done()
|
||||
})
|
||||
@ -41,7 +45,7 @@ describe('libp2p-websockets', () => {
|
||||
const s = goodbye({
|
||||
source: pull.values([rawMessage]),
|
||||
sink: pull.collect((err, results) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
expect(results).to.be.eql([rawMessage])
|
||||
done()
|
||||
})
|
||||
@ -57,7 +61,7 @@ describe('libp2p-websockets', () => {
|
||||
pull.map((val) => Buffer(val.toString()))
|
||||
),
|
||||
sink: pull.collect((err, result) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
expect(result).to.have.length(1000)
|
||||
done()
|
||||
})
|
||||
|
33
test/node.js
33
test/node.js
@ -1,7 +1,10 @@
|
||||
/* eslint-env mocha */
|
||||
'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 pull = require('pull-stream')
|
||||
const goodbye = require('pull-goodbye')
|
||||
@ -13,7 +16,7 @@ require('./compliance.node')
|
||||
describe('instantiate the transport', () => {
|
||||
it('create', () => {
|
||||
const ws = new WS()
|
||||
expect(ws).to.exist
|
||||
expect(ws).to.exist()
|
||||
})
|
||||
})
|
||||
|
||||
@ -77,7 +80,7 @@ describe('listen', () => {
|
||||
const listener = ws.createListener((conn) => {})
|
||||
listener.listen(ma, () => {
|
||||
listener.getAddrs((err, addrs) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
expect(addrs.length).to.equal(1)
|
||||
expect(addrs[0]).to.deep.equal(ma)
|
||||
listener.close(done)
|
||||
@ -103,7 +106,7 @@ describe('listen', () => {
|
||||
const listener = ws.createListener((conn) => {})
|
||||
listener.listen(ma, () => {
|
||||
listener.getAddrs((err, addrs) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
expect(addrs.length).to.equal(1)
|
||||
expect(addrs[0]).to.deep.equal(ma)
|
||||
listener.close(done)
|
||||
@ -135,7 +138,7 @@ describe('dial', () => {
|
||||
const s = goodbye({
|
||||
source: pull.values(['hey']),
|
||||
sink: pull.collect((err, result) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
|
||||
expect(result).to.be.eql(['hey'])
|
||||
done()
|
||||
@ -156,7 +159,7 @@ describe('dial', () => {
|
||||
const s = goodbye({
|
||||
source: pull.values(['hey']),
|
||||
sink: pull.collect((err, result) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
|
||||
expect(result).to.be.eql(['hey'])
|
||||
done()
|
||||
@ -207,10 +210,10 @@ describe('valid Connection', () => {
|
||||
const ws = new WS()
|
||||
|
||||
const listener = ws.createListener((conn) => {
|
||||
expect(conn).to.exist
|
||||
expect(conn).to.exist()
|
||||
|
||||
conn.getObservedAddrs((err, addrs) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
dialerObsAddrs = addrs
|
||||
})
|
||||
|
||||
@ -228,7 +231,7 @@ describe('valid Connection', () => {
|
||||
|
||||
function onEnd () {
|
||||
conn.getObservedAddrs((err, addrs) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
listenerObsAddrs = addrs
|
||||
|
||||
listener.close(onClose)
|
||||
@ -246,10 +249,10 @@ describe('valid Connection', () => {
|
||||
const ws = new WS()
|
||||
|
||||
const listener = ws.createListener((conn) => {
|
||||
expect(conn).to.exist
|
||||
expect(conn).to.exist()
|
||||
|
||||
conn.getPeerInfo((err, peerInfo) => {
|
||||
expect(err).to.exist
|
||||
expect(err).to.exist()
|
||||
})
|
||||
|
||||
pull(conn, conn)
|
||||
@ -266,7 +269,7 @@ describe('valid Connection', () => {
|
||||
|
||||
function onEnd () {
|
||||
conn.getPeerInfo((err, peerInfo) => {
|
||||
expect(err).to.exit
|
||||
expect(err).to.exist()
|
||||
listener.close(done)
|
||||
})
|
||||
}
|
||||
@ -277,11 +280,11 @@ describe('valid Connection', () => {
|
||||
const ws = new WS()
|
||||
|
||||
const listener = ws.createListener((conn) => {
|
||||
expect(conn).to.exist
|
||||
expect(conn).to.exist()
|
||||
conn.setPeerInfo('a')
|
||||
|
||||
conn.getPeerInfo((err, peerInfo) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
expect(peerInfo).to.equal('a')
|
||||
})
|
||||
|
||||
@ -301,7 +304,7 @@ describe('valid Connection', () => {
|
||||
|
||||
function onEnd () {
|
||||
conn.getPeerInfo((err, peerInfo) => {
|
||||
expect(err).to.not.exist
|
||||
expect(err).to.not.exist()
|
||||
expect(peerInfo).to.equal('b')
|
||||
listener.close(done)
|
||||
})
|
||||
|
Reference in New Issue
Block a user