test: use arrow functions in callbacks

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
apoorvanand authored and Michaël Zasso committed 2018-11-28 16:33:34 +01:00
1 parent 85aa03085d
commit 9d5455515c
1 file changed
+4 -4
@@ -22,14 +22,14 @@ 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);
@@ -37,7 +37,7 @@ writer1.once('chunk-received', function() {
});
// A "slow" consumer:
writer2._write = common.mustCall(function(chunk, encoding, cb) {
writer2._write = common.mustCall((chunk, encoding, cb) => {
assert.strictEqual(
reader._readableState.awaitDrain,
1,
@@ -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,