This is a little getting strarted to fast get into JEST basics for Node testing. Here is the index of the topics, organized as short tutorials that you can execute readily, simply uncommenting the lines below the "TUTORIAL" introduction section inside provatest.test.js .
- Create a TEST
- Create a real test
- Create many tests!
- Make a complex test
- Tidy up your test
- DESCRIBE your many tests
- Please AWAIT for me
- Create a module with one function. 1.1. Remember to export the functions you want to test.
- Create a file with the same name of the previous module and add '.test' to its name.
- From a Terminal launch
npm t NAMEOFTHEMODULE
If an error is raised about the command jest not found, check the installation steps:
- please make be sure that package-lock contains 'jest' as value of scripts.test .
- eventually delete the package-lock and type
npm init again