Skip to content

Commit df1d988

Browse files
TrottMylesBorins
authored andcommitted
doc: explain common.restore* functions
Explain that `common.restoreStderr()` and `common.restoreStdout()` are for use with `common.hijackStderr()` and `common.hijackStdout()` respectively. PR-URL: #15720 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 995948a commit df1d988

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/common/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,13 @@ Deletes the 'tmp' dir and recreates it
323323

324324
### restoreStderr()
325325

326-
Restore the original `process.stderr.write`.
326+
Restore the original `process.stderr.write`. Used to restore `stderr` to its
327+
original state after calling [`common.hijackStdErr()`][].
327328

328329
### restoreStdout()
329330

330-
Restore the original `process.stdout.write`.
331+
Restore the original `process.stdout.write`. Used to restore `stdout` to its
332+
original state after calling [`common.hijackStdOut()`][].
331333

332334
### rootDir
333335
* return [&lt;String>]
@@ -456,4 +458,6 @@ implementation with tests from
456458
[&lt;Object>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
457459
[&lt;RegExp>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
458460
[&lt;String>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type
461+
[`common.hijackStdErr()`]: #hijackstderrlistener
462+
[`common.hijackStdOut()`]: #hijackstdoutlistener
459463
[internationalization]: https://github.com/nodejs/node/wiki/Intl

0 commit comments

Comments
 (0)