December 2018
Intermediate to advanced
642 pages
15h 5m
English
To run the tests, we'll have to edit a script in package.json. Change the "test" script, which up till now had just an error message, so it will read as follows:
"test": "jest out/"
The "test" script can be run just by typing npm test. In our case, since our output code goes into the out/ directory we are telling Jest to inspect that directory, and run all tests (*.test.js files, by default) that it can find. You can modify Jest's configuration for more specific cases, but in general, it works well with zero configuration. The output is short and practical, as shown in the following screenshot:

Read now
Unlock full access