diff options
author | James M Snell <jasnell@gmail.com> | 2018-08-22 09:17:19 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-08-24 09:53:58 -0700 |
commit | 5da834f685f85af477afcb193d283f14a5244025 (patch) | |
tree | 1d86045f11e1cad9622be34a8a907b4972493624 /test/parallel/test-util-log.js | |
parent | ea8b932f30665436796c7e5abd485f048a0f41c8 (diff) | |
download | android-node-v8-5da834f685f85af477afcb193d283f14a5244025.tar.gz android-node-v8-5da834f685f85af477afcb193d283f14a5244025.tar.bz2 android-node-v8-5da834f685f85af477afcb193d283f14a5244025.zip |
test: move hijackstdio out of require('common')
Move the hijackstdio functions out of common so that they are
imported only into the tests that actually need them
PR-URL: https://github.com/nodejs/node/pull/22462
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-util-log.js')
-rw-r--r-- | test/parallel/test-util-log.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index 907a361e97..4d81fc8f7a 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -21,6 +21,11 @@ 'use strict'; const common = require('../common'); +const { + hijackStdout, + hijackStderr, + restoreStdout, +} = require('../common/hijackstdio'); const assert = require('assert'); const util = require('util'); @@ -28,10 +33,10 @@ assert.ok(process.stdout.writable); assert.ok(process.stderr.writable); const strings = []; -common.hijackStdout(function(data) { +hijackStdout(function(data) { strings.push(data); }); -common.hijackStderr(common.mustNotCall('stderr.write must not be called')); +hijackStderr(common.mustNotCall('stderr.write must not be called')); const tests = [ { input: 'foo', output: 'foo' }, @@ -57,4 +62,4 @@ tests.forEach(function(test) { assert.strictEqual(process.stdout.writeTimes, tests.length); -common.restoreStdout(); +restoreStdout(); |