Skip to content

Commit

Permalink
test: use arrow functions in callbacks
Browse files Browse the repository at this point in the history
PR-URL: #24441
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
apoorvanand authored and targos committed Nov 28, 2018
1 parent 85aa030 commit 9d54555
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-stream-pipe-await-drain.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ writer1._write = common.mustCall(function(chunk, encoding, cb) {
cb();
}, 1);

writer1.once('chunk-received', function() {
writer1.once('chunk-received', () => {
assert.strictEqual(
reader._readableState.awaitDrain,
0,
'awaitDrain initial value should be 0, actual is ' +
reader._readableState.awaitDrain
);
setImmediate(function() {
setImmediate(() => {
// This one should *not* get through to writer1 because writer2 is not
// "done" processing.
reader.push(buffer);
});
});

// A "slow" consumer:
writer2._write = common.mustCall(function(chunk, encoding, cb) {
writer2._write = common.mustCall((chunk, encoding, cb) => {
assert.strictEqual(
reader._readableState.awaitDrain,
1,
Expand All @@ -49,7 +49,7 @@ writer2._write = common.mustCall(function(chunk, encoding, cb) {
// will return false.
}, 1);

writer3._write = common.mustCall(function(chunk, encoding, cb) {
writer3._write = common.mustCall((chunk, encoding, cb) => {
assert.strictEqual(
reader._readableState.awaitDrain,
2,
Expand Down

0 comments on commit 9d54555

Please sign in to comment.