javascript testing

jest

set up

  1. npm init @vite/app
  2. npm install jest --save-dev
  3. test files must be names something.test.js
  4. add test script to package.json "test": "jest --watchAll --verbose"
  5. ideally add types for intelisense npm install @types/jest --save-dev(typescript). and also fix eslint by adding env:jest:true

flags

cmd: jest

neotest

for neotest I might have to install jest globally npm install -g jest
also to generate a basic config file I can run jest --init that walks me through some basic configs.

vitest

playwright

for integration testing
end to end testing tool and browser automation. it is used to simulate user interactions with web apps in real browsers.