From b5c5d206af8fd32f33953d564a151a5a20bfb5b1 Mon Sep 17 00:00:00 2001 From: apoorvanand Date: Sat, 17 Nov 2018 18:28:07 +0530 Subject: [PATCH] test: use arrow functions in callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/24441 Reviewed-By: Michaƫl Zasso Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Gireesh Punathil --- test/parallel/test-stream-pipe-await-drain.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-stream-pipe-await-drain.js b/test/parallel/test-stream-pipe-await-drain.js index 53cf54940d34e1..9286ceb791ce5f 100644 --- a/test/parallel/test-stream-pipe-await-drain.js +++ b/test/parallel/test-stream-pipe-await-drain.js @@ -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,