summaryrefslogtreecommitdiff
path: root/test/parallel/test-child-process-exec-encoding.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-05-12 12:02:38 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-05-21 17:50:25 +0200
commit352ae2397434ddde058c14cd357e3bdd1d029cb6 (patch)
tree4d8e480df7cbff9b964b4b530185ef60a31e6192 /test/parallel/test-child-process-exec-encoding.js
parentc041a2ee5bc7c89d846a53e4873dd394c19ec4c4 (diff)
downloadandroid-node-v8-352ae2397434ddde058c14cd357e3bdd1d029cb6.tar.gz
android-node-v8-352ae2397434ddde058c14cd357e3bdd1d029cb6.tar.bz2
android-node-v8-352ae2397434ddde058c14cd357e3bdd1d029cb6.zip
test: reduce runtime
This refactors some tests to reduce the runtime of those. PR-URL: https://github.com/nodejs/node/pull/20688 Refs: https://github.com/nodejs/node/issues/20128 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org>
Diffstat (limited to 'test/parallel/test-child-process-exec-encoding.js')
-rw-r--r--test/parallel/test-child-process-exec-encoding.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-child-process-exec-encoding.js b/test/parallel/test-child-process-exec-encoding.js
index 781ee51d96..d7c059a65a 100644
--- a/test/parallel/test-child-process-exec-encoding.js
+++ b/test/parallel/test-child-process-exec-encoding.js
@@ -1,17 +1,17 @@
'use strict';
const common = require('../common');
-const assert = require('assert');
-const cp = require('child_process');
const stdoutData = 'foo';
const stderrData = 'bar';
-const expectedStdout = `${stdoutData}\n`;
-const expectedStderr = `${stderrData}\n`;
if (process.argv[2] === 'child') {
// The following console calls are part of the test.
console.log(stdoutData);
console.error(stderrData);
} else {
+ const assert = require('assert');
+ const cp = require('child_process');
+ const expectedStdout = `${stdoutData}\n`;
+ const expectedStderr = `${stderrData}\n`;
function run(options, callback) {
const cmd = `"${process.execPath}" "${__filename}" child`;