Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 28b6129

Browse filesBrowse files
Viacheslav LiakhovMylesBorins
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 23d6932 commit 28b6129
Copy full SHA for 28b6129

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-flush-stdio.js
+6-6Lines changed: 6 additions & 6 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.