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 13241bd

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: remove unused vars in ChildProcess tests
In addition to removing unused vars, this also fixes an instance where booleans were set presumably to check something but then never used. This now confirms that the events that were setting the booleans are fired. PR-URL: #4425 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 2f4538d commit 13241bd
Copy full SHA for 13241bd
Expand file treeCollapse file tree

12 files changed

+5
-25
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-child-process-buffering.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-buffering.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
var common = require('../common');
33
var assert = require('assert');
44

5-
var spawn = require('child_process').spawn;
6-
75
var pwd_called = false;
86
var childClosed = false;
97
var childExited = false;
Collapse file

‎test/parallel/test-child-process-cwd.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-cwd.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22
var common = require('../common');
33
var assert = require('assert');
4-
var spawn = require('child_process').spawn;
5-
var path = require('path');
64

75
var returns = 0;
86

Collapse file

‎test/parallel/test-child-process-exec-buffer.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-exec-buffer.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var success_count = 0;
99
var str = 'hello';
1010

1111
// default encoding
12-
var child = exec('echo ' + str, function(err, stdout, stderr) {
12+
exec('echo ' + str, function(err, stdout, stderr) {
1313
assert.ok('string', typeof(stdout), 'Expected stdout to be a string');
1414
assert.ok('string', typeof(stderr), 'Expected stderr to be a string');
1515
assert.equal(str + os.EOL, stdout);
Collapse file

‎test/parallel/test-child-process-exec-cwd.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-exec-cwd.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if (common.isWindows) {
1616
dir = '/dev';
1717
}
1818

19-
var child = exec(pwdcommand, {cwd: dir}, function(err, stdout, stderr) {
19+
exec(pwdcommand, {cwd: dir}, function(err, stdout, stderr) {
2020
if (err) {
2121
error_count++;
2222
console.log('error!: ' + err.code);
Collapse file

‎test/parallel/test-child-process-fork-dgram.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-fork-dgram.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ if (common.isWindows) {
2525
}
2626

2727
if (process.argv[2] === 'child') {
28-
var childCollected = 0;
2928
var server;
3029

3130
process.on('message', function removeMe(msg, clusterServer) {
Collapse file

‎test/parallel/test-child-process-fork-exec-path.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-fork-exec-path.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
var assert = require('assert');
3-
var cp = require('child_process');
43
var fs = require('fs');
54
var path = require('path');
65
var common = require('../common');
Collapse file

‎test/parallel/test-child-process-fork-ref2.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-fork-ref2.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
require('../common');
3-
var assert = require('assert');
43
var fork = require('child_process').fork;
54

65
if (process.argv[2] === 'child') {
Collapse file

‎test/parallel/test-child-process-spawn-error.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-spawn-error.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
var common = require('../common');
3-
var fs = require('fs');
43
var spawn = require('child_process').spawn;
54
var assert = require('assert');
65

Collapse file

‎test/parallel/test-child-process-stdin.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-stdin.js
+2-12Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,20 @@ var response = '';
1818
var exitStatus = -1;
1919
var closed = false;
2020

21-
var gotStdoutEOF = false;
22-
2321
cat.stdout.setEncoding('utf8');
2422
cat.stdout.on('data', function(chunk) {
2523
console.log('stdout: ' + chunk);
2624
response += chunk;
2725
});
2826

29-
cat.stdout.on('end', function() {
30-
gotStdoutEOF = true;
31-
});
32-
33-
34-
var gotStderrEOF = false;
27+
cat.stdout.on('end', common.mustCall(function() {}));
3528

3629
cat.stderr.on('data', function(chunk) {
3730
// shouldn't get any stderr output
3831
assert.ok(false);
3932
});
4033

41-
cat.stderr.on('end', function(chunk) {
42-
gotStderrEOF = true;
43-
});
44-
34+
cat.stderr.on('end', common.mustCall(function() {}));
4535

4636
cat.on('exit', function(status) {
4737
console.log('exit event');
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-stdio-inherit.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ function grandparent() {
3131

3232
function parent() {
3333
// should not immediately exit.
34-
var child = common.spawnCat({ stdio: 'inherit' });
34+
common.spawnCat({ stdio: 'inherit' });
3535
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.