We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62478eb commit 92f163eCopy full SHA for 92f163e
doc/guides/writing_tests.md
@@ -3,11 +3,13 @@
3
## What is a test?
4
5
A test must be a node script that exercises a specific functionality provided
6
-by node and checks that it behaves as expected. It should return 0 on success,
+by node and checks that it behaves as expected. It should exit with code `0` on success,
7
otherwise it will fail. A test will fail if:
8
9
-- It exits by calling `process.exit(code)` where `code != 0`
10
-- It exits due to an uncaught exception.
+- It exits by setting `process.exitCode` to a non-zero number.
+ - This is most often done by having an assertion throw an uncaught
11
+ Error.
12
+ - Occasionally, using `process.exit(code)` may be appropriate.
13
- It never exits. In this case, the test runner will terminate the test because
14
it sets a maximum time limit.
15
0 commit comments