/learn-jest

Learning jest following tutorial from test automation university

Primary LanguageJavaScript

Note

This is created based on Jest Javascript testing framework course from Test Automation University by instructor Toyer Mamoojee

Setup

Execute in terminal:

node -v

npm -v

npm init -y

npm install --save-dev jest

Run tests

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

Resources

Tools

3 ways to handle asynchnous testing in Jest:

  • Callbacks
  • Promises
  • async / await