Skip to content

Commit c664603

Browse files
test: simplify webstreams compression regression test
1 parent 25e32d0 commit c664603

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

test/parallel/test-webstreams-compression-buffer-source.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ test('DecompressionStream accepts ArrayBuffer chunks', async () => {
1818
const writePromise = writer.write(compressedGzip.buffer);
1919
writer.close();
2020

21-
const chunks = [];
22-
let done = false;
23-
while (!done) {
24-
const { value, done: d } = await reader.read();
25-
if (value) chunks.push(value);
26-
done = d;
27-
}
21+
const chunks = await Array.fromAsync(ds.readable);
2822
await writePromise;
2923
const out = Buffer.concat(chunks.map((c) => Buffer.from(c)));
3024
assert.strictEqual(out.toString(), 'hello');

0 commit comments

Comments
 (0)