Skip to content

Commit 9d54555

Browse files
apoorvanandtargos
authored andcommittedNov 28, 2018
test: use arrow functions in callbacks
PR-URL: #24441 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 85aa030 commit 9d54555

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎test/parallel/test-stream-pipe-await-drain.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ writer1._write = common.mustCall(function(chunk, encoding, cb) {
2222
cb();
2323
}, 1);
2424

25-
writer1.once('chunk-received', function() {
25+
writer1.once('chunk-received', () => {
2626
assert.strictEqual(
2727
reader._readableState.awaitDrain,
2828
0,
2929
'awaitDrain initial value should be 0, actual is ' +
3030
reader._readableState.awaitDrain
3131
);
32-
setImmediate(function() {
32+
setImmediate(() => {
3333
// This one should *not* get through to writer1 because writer2 is not
3434
// "done" processing.
3535
reader.push(buffer);
3636
});
3737
});
3838

3939
// A "slow" consumer:
40-
writer2._write = common.mustCall(function(chunk, encoding, cb) {
40+
writer2._write = common.mustCall((chunk, encoding, cb) => {
4141
assert.strictEqual(
4242
reader._readableState.awaitDrain,
4343
1,
@@ -49,7 +49,7 @@ writer2._write = common.mustCall(function(chunk, encoding, cb) {
4949
// will return false.
5050
}, 1);
5151

52-
writer3._write = common.mustCall(function(chunk, encoding, cb) {
52+
writer3._write = common.mustCall((chunk, encoding, cb) => {
5353
assert.strictEqual(
5454
reader._readableState.awaitDrain,
5555
2,

0 commit comments

Comments
 (0)