Skip to content

Commit 28587d2

Browse files
authored
fix: update websockets tests (#2337)
The types for it-goodbye have become less permissive.
1 parent f1c1167 commit 28587d2

File tree

1 file changed

+21
-4
lines changed
  • packages/transport-websockets/test

1 file changed

+21
-4
lines changed

packages/transport-websockets/test/node.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,12 @@ describe('dial', () => {
353353

354354
// Dial first no loopback address
355355
const conn = await ws.dial(addrs[0], { upgrader })
356-
const s = goodbye({ source: [uint8ArrayFromString('hey')], sink: all })
356+
const s = goodbye({
357+
source: (async function * () {
358+
yield uint8ArrayFromString('hey')
359+
})(),
360+
sink: all
361+
})
357362
const stream = await conn.newStream([protocol])
358363

359364
await expect(pipe(
@@ -404,7 +409,12 @@ describe('dial', () => {
404409

405410
it('dial ip4', async () => {
406411
const conn = await ws.dial(ma, { upgrader })
407-
const s = goodbye({ source: [uint8ArrayFromString('hey')], sink: all })
412+
const s = goodbye({
413+
source: (async function * () {
414+
yield uint8ArrayFromString('hey')
415+
})(),
416+
sink: all
417+
})
408418
const stream = await conn.newStream([protocol])
409419

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

439449
it('dial ip6', async () => {
440450
const conn = await ws.dial(ma, { upgrader })
441-
const s = goodbye({ source: [uint8ArrayFromString('hey')], sink: all })
451+
const s = goodbye({
452+
source: (async function * () {
453+
yield uint8ArrayFromString('hey')
454+
})(),
455+
sink: all
456+
})
442457
const stream = await conn.newStream([protocol])
443458

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

451466
const s = goodbye({
452-
source: [uint8ArrayFromString('hey')],
467+
source: (async function * () {
468+
yield uint8ArrayFromString('hey')
469+
})(),
453470
sink: all
454471
})
455472
const stream = await conn.newStream([protocol])

0 commit comments

Comments
 (0)