doc: fix nits in writing-tests.md
* Correct a typo. * Normalize spaces. * Split a paragraph with different topics. PR-URL: https://github.com/nodejs/node/pull/26543 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
97ce5e0b4b
commit
4e9dc31817
@ -285,16 +285,18 @@ assert.throws(
|
|||||||
|
|
||||||
Output written by tests to stdout or stderr, such as with `console.log()` or
|
Output written by tests to stdout or stderr, such as with `console.log()` or
|
||||||
`console.error()`, can be useful when writing tests, as well as for debugging
|
`console.error()`, can be useful when writing tests, as well as for debugging
|
||||||
them during later maintenance. The output will be supressed by the test runner
|
them during later maintenance. The output will be suppressed by the test runner
|
||||||
(`./tools/test.py`) unless the test fails, but will always be displayed when
|
(`./tools/test.py`) unless the test fails, but will always be displayed when
|
||||||
running tests directly with `node`. For failing tests, the test runner will
|
running tests directly with `node`. For failing tests, the test runner will
|
||||||
include the output along with the failed test assertion in the test report.
|
include the output along with the failed test assertion in the test report.
|
||||||
|
|
||||||
Some output can help debugging by giving context to test failures. For example,
|
Some output can help debugging by giving context to test failures. For example,
|
||||||
when troubleshooting tests that timeout in CI. With no log statements, we have
|
when troubleshooting tests that timeout in CI. With no log statements, we have
|
||||||
no idea where the test got hung up. There have been cases where tests fail
|
no idea where the test got hung up.
|
||||||
without `console.log()`, and then pass when its added, so be cautious about its
|
|
||||||
use, particularly in tests of the I/O and streaming APIs.
|
There have been cases where tests fail without `console.log()`, and then pass
|
||||||
|
when its added, so be cautious about its use, particularly in tests of the I/O
|
||||||
|
and streaming APIs.
|
||||||
|
|
||||||
Excessive use of console output is discouraged as it can overwhelm the display,
|
Excessive use of console output is discouraged as it can overwhelm the display,
|
||||||
including the Jenkins console and test report displays. Be particularly
|
including the Jenkins console and test report displays. Be particularly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user