From 28587d24f41f8342d9db30d83e6010def55d4268 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 28 Dec 2023 12:35:34 +0100 Subject: [PATCH] fix: update websockets tests (#2337) The types for it-goodbye have become less permissive. --- packages/transport-websockets/test/node.ts | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/transport-websockets/test/node.ts b/packages/transport-websockets/test/node.ts index 61aee9ec76..23c9bff2ff 100644 --- a/packages/transport-websockets/test/node.ts +++ b/packages/transport-websockets/test/node.ts @@ -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( @@ -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) @@ -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')]) @@ -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])