Skip to content

Commit

Permalink
[ML] Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed May 20, 2022
1 parent 2b2f1b8 commit d300eda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/kbn-aiops-utils/src/lib/stream_factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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',
});

Expand All @@ -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);
}

Expand Down

0 comments on commit d300eda

Please sign in to comment.