Skip to content

Commit

Permalink
test: use arrow function
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.

PR-URL: #24482
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
sagirk authored and BethGriggs committed Feb 12, 2019
1 parent e5abfe1 commit 2318c7f
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 2318c7f

Please sign in to comment.