From d300eda23e9bd7d8bd004dfff2348b57e74fb954 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Fri, 20 May 2022 12:50:05 +0200 Subject: [PATCH] [ML] Fix tests. --- packages/kbn-aiops-utils/src/lib/stream_factory.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/kbn-aiops-utils/src/lib/stream_factory.test.ts b/packages/kbn-aiops-utils/src/lib/stream_factory.test.ts index 6d251c08439f1c..6b95bdb5aeb578 100644 --- a/packages/kbn-aiops-utils/src/lib/stream_factory.test.ts +++ b/packages/kbn-aiops-utils/src/lib/stream_factory.test.ts @@ -29,14 +29,14 @@ describe('streamFactory', () => { }); it('should encode and receive an uncompressed stream', async () => { - const { DELIMITER, end, push, responseWithHeaders, stream } = streamFactory(mockLogger, {}); + const { DELIMITER, end, push, responseWithHeaders } = streamFactory(mockLogger, {}); push(mockItem1); push(mockItem2); end(); let streamResult = ''; - for await (const chunk of stream) { + for await (const chunk of responseWithHeaders.body) { streamResult += chunk.toString('utf8'); } @@ -62,7 +62,7 @@ describe('streamFactory', () => { // without the need for additional custom code. it('should encode and receive a compressed stream', (done) => { (async () => { - const { DELIMITER, end, push, responseWithHeaders, stream } = streamFactory(mockLogger, { + const { DELIMITER, end, push, responseWithHeaders } = streamFactory(mockLogger, { 'accept-encoding': 'gzip', }); @@ -71,7 +71,7 @@ describe('streamFactory', () => { end(); const chunks = []; - for await (const chunk of stream) { + for await (const chunk of responseWithHeaders.body) { chunks.push(chunk); }