Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 28b6129

Browse files
Viacheslav LiakhovMylesBorins
Viacheslav Liakhov
authored andcommittedOct 30, 2018
test: modernize test-child-process-flush-stdio
PR-URL: #23504 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 23d6932 commit 28b6129

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎test/parallel/test-child-process-flush-stdio.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ const opts = { shell: common.isWindows };
99

1010
const p = cp.spawn('echo', [], opts);
1111

12-
p.on('close', common.mustCall(function(code, signal) {
12+
p.on('close', common.mustCall((code, signal) => {
1313
assert.strictEqual(code, 0);
1414
assert.strictEqual(signal, null);
1515
spawnWithReadable();
1616
}));
1717

1818
p.stdout.read();
1919

20-
function spawnWithReadable() {
20+
const spawnWithReadable = () => {
2121
const buffer = [];
2222
const p = cp.spawn('echo', ['123'], opts);
23-
p.on('close', common.mustCall(function(code, signal) {
23+
p.on('close', common.mustCall((code, signal) => {
2424
assert.strictEqual(code, 0);
2525
assert.strictEqual(signal, null);
2626
assert.strictEqual(Buffer.concat(buffer).toString().trim(), '123');
2727
}));
28-
p.stdout.on('readable', function() {
28+
p.stdout.on('readable', () => {
2929
let buf;
30-
while (buf = this.read())
30+
while (buf = p.stdout.read())
3131
buffer.push(buf);
3232
});
33-
}
33+
};

0 commit comments

Comments
 (0)
Please sign in to comment.