Skip to content

Commit 0767eba

Browse files
committed
test: refactor test-child-process-env to use arrow functions
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.
1 parent 4eb9908 commit 0767eba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-child-process-env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ let response = '';
4848

4949
child.stdout.setEncoding('utf8');
5050

51-
child.stdout.on('data', function(chunk) {
51+
child.stdout.on('data', (chunk) => {
5252
console.log(`stdout: ${chunk}`);
5353
response += chunk;
5454
});
5555

56-
process.on('exit', function() {
56+
process.on('exit', () => {
5757
assert.ok(response.includes('HELLO=WORLD'));
5858
assert.ok(response.includes('FOO=BAR'));
5959
assert.ok(!response.includes('UNDEFINED=undefined'));

0 commit comments

Comments
 (0)