summaryrefslogtreecommitdiff
path: root/test/parallel/test-child-process-spawn-typeerror.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-02-10 02:33:08 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-16 16:54:07 +0100
commit644fdd60d4be49ffa66d0bda1702c4459f607635 (patch)
tree70da98bc22a5a6c5bd0063e25d6eb729125706bf /test/parallel/test-child-process-spawn-typeerror.js
parentcaee112e52b64f4bc1118c4a5fa5ad7b4211efea (diff)
downloadandroid-node-v8-644fdd60d4be49ffa66d0bda1702c4459f607635.tar.gz
android-node-v8-644fdd60d4be49ffa66d0bda1702c4459f607635.tar.bz2
android-node-v8-644fdd60d4be49ffa66d0bda1702c4459f607635.zip
test: minor refactoring
Add punctuation and comments about code that should not throw. Also remove a obsolete test and refactor some tests. PR-URL: https://github.com/nodejs/node/pull/18669 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-child-process-spawn-typeerror.js')
-rw-r--r--test/parallel/test-child-process-spawn-typeerror.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/parallel/test-child-process-spawn-typeerror.js b/test/parallel/test-child-process-spawn-typeerror.js
index 25ae7df7aa..2a2c1de277 100644
--- a/test/parallel/test-child-process-spawn-typeerror.js
+++ b/test/parallel/test-child-process-spawn-typeerror.js
@@ -40,13 +40,13 @@ assert.throws(function() {
child.on('error', common.mustNotCall());
}, TypeError);
-// verify that valid argument combinations do not throw
+// Verify that valid argument combinations do not throw.
spawn(cmd);
spawn(cmd, []);
spawn(cmd, {});
spawn(cmd, [], {});
-// verify that invalid argument combinations throw
+// Verify that invalid argument combinations throw.
assert.throws(function() {
spawn();
}, invalidArgTypeError);
@@ -76,7 +76,7 @@ assert.throws(function() {
spawn(cmd, [], 1);
}, invalidArgTypeError);
-// Argument types for combinatorics
+// Argument types for combinatorics.
const a = [];
const o = {};
function c() {}
@@ -94,7 +94,7 @@ spawn(cmd, a);
spawn(cmd, a, o);
spawn(cmd, o);
-// Variants of undefined as explicit 'no argument' at a position
+// Variants of undefined as explicit 'no argument' at a position.
spawn(cmd, u, o);
spawn(cmd, a, u);
@@ -105,7 +105,7 @@ assert.throws(function() { spawn(cmd, s); }, invalidArgTypeError);
assert.throws(function() { spawn(cmd, a, s); }, invalidArgTypeError);
-// verify that execFile has same argument parsing behavior as spawn
+// Verify that execFile has same argument parsing behavior as spawn.
//
// function execFile(file=f [,args=a] [, options=o] [, callback=c]) has valid
// combinations:
@@ -126,7 +126,7 @@ execFile(cmd, o);
execFile(cmd, o, c);
execFile(cmd, c);
-// Variants of undefined as explicit 'no argument' at a position
+// Variants of undefined as explicit 'no argument' at a position.
execFile(cmd, u, o, c);
execFile(cmd, a, u, c);
execFile(cmd, a, o, u);
@@ -148,9 +148,9 @@ execFile(cmd, o, n);
execFile(cmd, c, u);
execFile(cmd, c, n);
-// string is invalid in arg position (this may seem strange, but is
+// String is invalid in arg position (this may seem strange, but is
// consistent across node API, cf. `net.createServer('not options', 'not
-// callback')`
+// callback')`.
assert.throws(function() { execFile(cmd, s, o, c); }, invalidArgValueError);
assert.throws(function() { execFile(cmd, a, s, c); }, invalidArgValueError);
assert.throws(function() { execFile(cmd, a, o, s); }, invalidArgValueError);
@@ -162,10 +162,10 @@ assert.throws(function() { execFile(cmd, a, u, s); }, invalidArgValueError);
assert.throws(function() { execFile(cmd, a, n, s); }, invalidArgValueError);
assert.throws(function() { execFile(cmd, u, o, s); }, invalidArgValueError);
assert.throws(function() { execFile(cmd, n, o, s); }, invalidArgValueError);
-execFile(cmd, c, s);
+execFile(cmd, c, s); // Should not throw.
-// verify that fork has same argument parsing behavior as spawn
+// Verify that fork has same argument parsing behavior as spawn.
//
// function fork(file=f [,args=a] [, options=o]) has valid combinations:
// (f)