Skip to content

Commit

Permalink
test: change the repeat Buffer.from('blerg'); statments
Browse files Browse the repository at this point in the history
PR-URL: nodejs#28372
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
themiken authored and Trott committed Jul 6, 2019
1 parent c25cccf commit 04cf202
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/parallel/test-stream-writable-constructor-set-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ w.on('error', common.expectsError({
message: 'The _write() method is not implemented'
}));

w.end(Buffer.from('blerg'));
const bufferBlerg = Buffer.from('blerg');

w.end(bufferBlerg);

const _write = common.mustCall((chunk, _, next) => {
next();
Expand All @@ -28,10 +30,10 @@ const w2 = new Writable({ write: _write, writev: _writev });
strictEqual(w2._write, _write);
strictEqual(w2._writev, _writev);

w2.write(Buffer.from('blerg'));
w2.write(bufferBlerg);

w2.cork();
w2.write(Buffer.from('blerg'));
w2.write(Buffer.from('blerg'));
w2.write(bufferBlerg);
w2.write(bufferBlerg);

w2.end();

0 comments on commit 04cf202

Please sign in to comment.