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:
parent
7d18e922ab
commit
b5c5d206af
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user