diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-20 12:15:06 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-27 17:05:15 +0100 |
commit | 28e2c3771d3da014c35b57cc55f7808627e43f2d (patch) | |
tree | fc2f8ffe0383c8694b5d20243149d13481e2660c /test | |
parent | 9e8c9be3ff07845320c350fa3b2097cfbdada85e (diff) | |
download | android-node-v8-28e2c3771d3da014c35b57cc55f7808627e43f2d.tar.gz android-node-v8-28e2c3771d3da014c35b57cc55f7808627e43f2d.tar.bz2 android-node-v8-28e2c3771d3da014c35b57cc55f7808627e43f2d.zip |
child_process: rename _validateStdtio to getValidStdio
The name indicated only validation while it did much more and it
returned a different value to the callee function. The underscore
was also not necessary as the function is internal one way or the
other.
PR-URL: https://github.com/nodejs/node/pull/26809
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-child-process-validate-stdio.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/parallel/test-child-process-validate-stdio.js b/test/parallel/test-child-process-validate-stdio.js index 3566c8f952..23b3fe2c95 100644 --- a/test/parallel/test-child-process-validate-stdio.js +++ b/test/parallel/test-child-process-validate-stdio.js @@ -3,21 +3,21 @@ const common = require('../common'); const assert = require('assert'); -const _validateStdio = require('internal/child_process')._validateStdio; +const getValidStdio = require('internal/child_process').getValidStdio; const expectedError = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: TypeError }, 2); // Should throw if string and not ignore, pipe, or inherit -assert.throws(() => _validateStdio('foo'), expectedError); +assert.throws(() => getValidStdio('foo'), expectedError); // Should throw if not a string or array -assert.throws(() => _validateStdio(600), expectedError); +assert.throws(() => getValidStdio(600), expectedError); // Should populate stdio with undefined if len < 3 { const stdio1 = []; - const result = _validateStdio(stdio1, false); + const result = getValidStdio(stdio1, false); assert.strictEqual(stdio1.length, 3); assert.strictEqual(result.hasOwnProperty('stdio'), true); assert.strictEqual(result.hasOwnProperty('ipc'), true); @@ -26,14 +26,14 @@ assert.throws(() => _validateStdio(600), expectedError); // Should throw if stdio has ipc and sync is true const stdio2 = ['ipc', 'ipc', 'ipc']; -common.expectsError(() => _validateStdio(stdio2, true), +common.expectsError(() => getValidStdio(stdio2, true), { code: 'ERR_IPC_SYNC_FORK', type: Error } ); if (common.isMainThread) { const stdio3 = [process.stdin, process.stdout, process.stderr]; - const result = _validateStdio(stdio3, false); + const result = getValidStdio(stdio3, false); assert.deepStrictEqual(result, { stdio: [ { type: 'fd', fd: 0 }, |