diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index 892fbb2398e7ac..b0e1e55af29a81 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -1463,12 +1463,7 @@ const tsp = require('timers/promises'); const stream = await pipelinePromise(read, duplex); - let ret = '' - for await (const x of stream) { - ret += x; - } - - assert.strictEqual(ret, 'data'); + assert.strictEqual(await stream.text(), 'data'); } run();