fix: tests

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
This commit is contained in:
Alan Shaw
2019-04-17 12:34:56 +01:00
parent f674122b6f
commit 24d0a6132a
6 changed files with 14 additions and 17 deletions

View File

@@ -74,8 +74,8 @@ describe('adapter libp2p-websockets', () => {
pull(s, conn, s)
})
})
})
it('.createServer throws in browser', () => {
expect(new WS().createListener).to.throw()
it('.createServer throws in browser', () => {
expect(new WS().createListener).to.throw()
})
})

View File

@@ -13,7 +13,7 @@ const { collect, take } = require('streaming-iterables')
const WS = require('../src')
// require('./adapter/browser')
require('./adapter/browser')
describe('libp2p-websockets', () => {
const ma = multiaddr('/ip4/127.0.0.1/tcp/9095/ws')
@@ -26,7 +26,7 @@ describe('libp2p-websockets', () => {
})
it('echo', async () => {
const message = 'Hello World!'
const message = Buffer.from('Hello World!')
const s = goodbye({ source: [message], sink: collect })
const results = await pipe(s, conn, s)
@@ -60,8 +60,8 @@ describe('libp2p-websockets', () => {
expect(result).to.have.length(20000)
})
})
})
it('.createServer throws in browser', () => {
expect(new WS().createListener).to.throw()
it('.createServer throws in browser', () => {
expect(new WS().createListener).to.throw()
})
})

View File

@@ -195,7 +195,7 @@ describe('dial', () => {
const result = await pipe(s, conn, s)
expect(result).to.be.eql(['hey'])
expect(result).to.be.eql([Buffer.from('hey')])
})
it('dial with IPFS Id', async () => {
@@ -205,7 +205,7 @@ describe('dial', () => {
const result = await pipe(s, conn, s)
expect(result).to.be.eql(['hey'])
expect(result).to.be.eql([Buffer.from('hey')])
})
})
@@ -228,7 +228,7 @@ describe('dial', () => {
const result = await pipe(s, conn, s)
expect(result).to.be.eql(['hey'])
expect(result).to.be.eql([Buffer.from('hey')])
})
it('dial with IPFS Id', async () => {
@@ -241,7 +241,7 @@ describe('dial', () => {
})
const result = await pipe(s, conn, s)
expect(result).to.be.eql(['hey'])
expect(result).to.be.eql([Buffer.from('hey')])
})
})
})