Setting up testing environment
So as usual, lets install it and add it to our development dependencies using the
npm install -D jest command.
npm i -D ts-jest @types/jest to add support for TypeScript.
Okay, so now we have what we need to create a config for it. To do that, run:
npx ts-jest config:init
You should see that
jest.config.js has been created in our project root.
The next step will be to change our test npm script in
"test": "jest" and add watch mode script, which looks like:
"test:watch": "npm test -- --watch",