javascript testing
jest
set up
npm init @vite/app
npm install jest --save-dev
- test files must be names
something.test.js
- add test script to
package.json
"test": "jest --watchAll --verbose"
- ideally add types for intelisense
npm install @types/jest --save-dev
(typescript). and also fix eslint by addingenv:jest:true
flags
cmd: jest
- --watchAll
- --watch
- --verbose
- --coverage: generates a report that tells me how much code in the project is being covered by my tests.
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.