Browse Source

doc: explain common.restore* functions

Explain that `common.restoreStderr()` and `common.restoreStdout()` are
for use with `common.hijackStderr()` and `common.hijackStdout()`
respectively.

PR-URL: https://github.com/nodejs/node/pull/15720
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
v9.x-staging
Rich Trott 7 years ago
parent
commit
463484b330
  1. 8
      test/common/README.md

8
test/common/README.md

@ -323,11 +323,13 @@ Deletes the 'tmp' dir and recreates it
### restoreStderr()
Restore the original `process.stderr.write`.
Restore the original `process.stderr.write`. Used to restore `stderr` to its
original state after calling [`common.hijackStdErr()`][].
### restoreStdout()
Restore the original `process.stdout.write`.
Restore the original `process.stdout.write`. Used to restore `stdout` to its
original state after calling [`common.hijackStdOut()`][].
### rootDir
* return [&lt;String>]
@ -456,4 +458,6 @@ implementation with tests from
[&lt;Object>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
[&lt;RegExp>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
[&lt;String>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type
[`common.hijackStdErr()`]: #hijackstderrlistener
[`common.hijackStdOut()`]: #hijackstdoutlistener
[internationalization]: https://github.com/nodejs/node/wiki/Intl

Loading…
Cancel
Save