Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: duplicated buffer in test-stream2-writable.js #28380

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
8 changes: 5 additions & 3 deletions test/parallel/test-stream2-writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,12 @@ for (let i = 0; i < chunks.length; i++) {
tw.end(common.mustCall());
}

const helloWorldBuffer = Buffer.from('hello world');

{
// Verify end() callback with chunk
const tw = new TestWriter();
tw.end(Buffer.from('hello world'), common.mustCall());
tw.end(helloWorldBuffer, common.mustCall());
}

{
Expand All @@ -244,15 +246,15 @@ for (let i = 0; i < chunks.length; i++) {
{
// Verify end() callback after write() call
const tw = new TestWriter();
tw.write(Buffer.from('hello world'));
tw.write(helloWorldBuffer);
tw.end(common.mustCall());
}

{
// Verify end() callback after write() callback
const tw = new TestWriter();
let writeCalledback = false;
tw.write(Buffer.from('hello world'), function() {
tw.write(helloWorldBuffer, function() {
writeCalledback = true;
});
tw.end(common.mustCall(function() {
Expand Down