mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
test: change callback function to arrow function
PR-URL: https://github.com/nodejs/node/pull/24421 Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
1dadaf90f6
commit
d964d276db
1 file changed
+3
-3
@@ -32,14 +32,14 @@ let nChunks = 10;
|
||||
const chunk = Buffer.alloc(10, 'x');
|
||||
|
||||
r._read = function(n) {
|
||||
setImmediate(function() {
|
||||
setImmediate(() => {
|
||||
r.push(--nChunks === 0 ? null : chunk);
|
||||
});
|
||||
};
|
||||
|
||||
let readAll = false;
|
||||
const seen = [];
|
||||
r.on('readable', function() {
|
||||
r.on('readable', () => {
|
||||
let chunk;
|
||||
while (chunk = r.read()) {
|
||||
seen.push(chunk.toString());
|
||||
@@ -74,7 +74,7 @@ const expect =
|
||||
'xxxxxxxxxx',
|
||||
'yyyyy' ];
|
||||
|
||||
r.on('end', function() {
|
||||
r.on('end', () => {
|
||||
assert.deepStrictEqual(seen, expect);
|
||||
console.log('ok');
|
||||
});
|
||||
Reference in new issue
Block a user