Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions packages/transport-websockets/test/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,12 @@ describe('dial', () => {

// Dial first no loopback address
const conn = await ws.dial(addrs[0], { upgrader })
const s = goodbye({ source: [uint8ArrayFromString('hey')], sink: all })
const s = goodbye({
source: (async function * () {
yield uint8ArrayFromString('hey')
})(),
sink: all
})
const stream = await conn.newStream([protocol])

await expect(pipe(
Expand Down Expand Up @@ -404,7 +409,12 @@ describe('dial', () => {

it('dial ip4', async () => {
const conn = await ws.dial(ma, { upgrader })
const s = goodbye({ source: [uint8ArrayFromString('hey')], sink: all })
const s = goodbye({
source: (async function * () {
yield uint8ArrayFromString('hey')
})(),
sink: all
})
const stream = await conn.newStream([protocol])

const res = await pipe(s, stream, toBuffers, s)
Expand Down Expand Up @@ -438,7 +448,12 @@ describe('dial', () => {

it('dial ip6', async () => {
const conn = await ws.dial(ma, { upgrader })
const s = goodbye({ source: [uint8ArrayFromString('hey')], sink: all })
const s = goodbye({
source: (async function * () {
yield uint8ArrayFromString('hey')
})(),
sink: all
})
const stream = await conn.newStream([protocol])

await expect(pipe(s, stream, toBuffers, s)).to.eventually.deep.equal([uint8ArrayFromString('hey')])
Expand All @@ -449,7 +464,9 @@ describe('dial', () => {
const conn = await ws.dial(ma, { upgrader })

const s = goodbye({
source: [uint8ArrayFromString('hey')],
source: (async function * () {
yield uint8ArrayFromString('hey')
})(),
sink: all
})
const stream = await conn.newStream([protocol])
Expand Down