mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-07-30 20:42:17 +00:00
fix: tests
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
@@ -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()
|
||||
})
|
||||
})
|
||||
|
@@ -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')])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user