This is created based on Jest Javascript testing framework course from Test Automation University by instructor Toyer Mamoojee
Execute in terminal:
node -v
npm -v
npm init -y
npm install --save-dev jest
run all from project:
npm run test
run single test file
npm run test <file_name>.test.js
run single test in file using test.only()
instead of test()
run tests in watch mode
npm run test:watch
- JEST - javascript testing framework
- expect doc
- matchers
- setup + teardown
- CLI options
- Testing asynchronous code
- Snapshot testing with Jest
3 ways to handle asynchnous testing in Jest:
- Callbacks
- Promises
- async / await