Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: change callback function to arrow function
  • Loading branch information
lshanmug committed Nov 17, 2018
commit 786d1c4a725ca34f2dde8fded8097b5fc472ced7
6 changes: 3 additions & 3 deletions test/parallel/test-stream-unshift-empty-chunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -74,7 +74,7 @@ const expect =
'xxxxxxxxxx',
'yyyyy' ];

r.on('end', function() {
r.on('end', () => {
assert.deepStrictEqual(seen, expect);
console.log('ok');
});