Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: test
  • Loading branch information
ronag committed Apr 28, 2020
commit bfd17cdfe30f09bab87de54651f0208b5e0da063
12 changes: 7 additions & 5 deletions test/parallel/test-stream-finished.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
// Regression https://github.com/nodejs/node/issues/33130

const response = new PassThrough();
setTimeout(() => response.write('chunk 1'), 500);
setTimeout(() => response.write('chunk 2'), 1000);
setTimeout(() => response.write('chunk 3'), 1500);
setTimeout(() => response.end(), 2000);
response.write('chunk 1');
response.write('chunk 2');
response.write('chunk 3');
response.end();
Comment thread
ronag marked this conversation as resolved.
Outdated

class HelloWorld extends Duplex {
constructor(response) {
Expand Down Expand Up @@ -453,9 +453,11 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
(async () => {
await new Promise((resolve) => setTimeout(resolve, 100));
Comment thread
ronag marked this conversation as resolved.
Outdated

instance.setEncoding('utf8');

let res = '';
for await (const data of instance) {
res += data.toString();
res += data;
}

assert.strictEqual(res, 'chunk 1chunk 2chunk 3');
Expand Down