Skip to content

Commit

Permalink
fix: update websockets tests (#2337)
Browse files Browse the repository at this point in the history
The types for it-goodbye have become less permissive.
  • Loading branch information
achingbrain committed Dec 28, 2023
1 parent f1c1167 commit 28587d2
Showing 1 changed file with 21 additions and 4 deletions.
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

0 comments on commit 28587d2

Please sign in to comment.