Skip to content
Permalink
Browse files

test: replace closure with arrow functions

PR-URL: #24438
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information...
Amanpreet-03 authored and rvagg committed Nov 17, 2018
1 parent d5543ea commit 585ebfffa70499261b02e58dc1f8b4ec57fda9ae
Showing with 7 additions and 7 deletions.
  1. +7 −7 test/parallel/test-stream2-readable-empty-buffer-no-eof.js
@@ -46,17 +46,17 @@ function test1() {
r._read = function(n) {
switch (reads--) {
case 5:
return setImmediate(function() {
return setImmediate(() => {
return r.push(buf);
});
case 4:
setImmediate(function() {
setImmediate(() => {
return r.push(Buffer.alloc(0));
});
return setImmediate(r.read.bind(r, 0));
case 3:
setImmediate(r.read.bind(r, 0));
return process.nextTick(function() {
return process.nextTick(() => {
return r.push(Buffer.alloc(0));
});
case 2:
@@ -78,12 +78,12 @@ function test1() {
results.push(String(chunk));
}
r.on('readable', flow);
r.on('end', function() {
r.on('end', () => {
results.push('EOF');
});
flow();

process.on('exit', function() {
process.on('exit', () => {
assert.deepStrictEqual(results, [ 'xxxxx', 'xxxxx', 'EOF' ]);
console.log('ok');
});
@@ -106,12 +106,12 @@ function test2() {
results.push(String(chunk));
}
r.on('readable', flow);
r.on('end', function() {
r.on('end', () => {
results.push('EOF');
});
flow();

process.on('exit', function() {
process.on('exit', () => {
assert.deepStrictEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]);
console.log('ok');
});

0 comments on commit 585ebff

Please sign in to comment.
You can’t perform that action at this time.