Skip to content

Commit

Permalink
test: refactor test-child-process-env to use arrow functions
Browse files Browse the repository at this point in the history
In `test/parallel/test-child-process-env.js`, callbacks use
anonymous closure functions. It is safe to replace them with arrow
functions since these callbacks don't contain references to `this`,
`super` or `arguments`. This results in shorter functions.
  • Loading branch information
sagirk committed Nov 21, 2018
1 parent 4eb9908 commit 0767eba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-child-process-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ let response = '';

child.stdout.setEncoding('utf8');

child.stdout.on('data', function(chunk) {
child.stdout.on('data', (chunk) => {
console.log(`stdout: ${chunk}`);
response += chunk;
});

process.on('exit', function() {
process.on('exit', () => {
assert.ok(response.includes('HELLO=WORLD'));
assert.ok(response.includes('FOO=BAR'));
assert.ok(!response.includes('UNDEFINED=undefined'));
Expand Down

0 comments on commit 0767eba

Please sign in to comment.