Skip to content

Commit e087f26

Browse files
Viacheslav Liakhovjasnell
Viacheslav Liakhov
authored andcommitted
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 c377053 commit e087f26

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)