File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3
3
## What is a test?
4
4
5
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,
6
+ by node and checks that it behaves as expected. It should exit with code ` 0 ` on success,
7
7
otherwise it will fail. A test will fail if:
8
8
9
- - It exits by calling ` process.exit(code) ` where ` code != 0 `
10
- - It exits due to an uncaught exception.
9
+ - It exits by setting ` process.exitCode ` to a non-zero number.
10
+ - This is most often done by having an assertion throw an uncaught
11
+ Error.
12
+ - Occasionally, using ` process.exit(code) ` may be appropriate.
11
13
- It never exits. In this case, the test runner will terminate the test because
12
14
it sets a maximum time limit.
13
15
You can’t perform that action at this time.
0 commit comments