Install jest and other packages, in my case I had Jest 26.6 installed :
npm i jest @types/jest ts-jest typescript -D
If your package.json file contains "type": "module", [which causes Node to assume modules are in es6 format, you may have to remove that line].
Create a jest.config.js in the root folder ( you could create a config file like so npx jest –init but the default generated did not work for me.):
module.exports = { "roots": [ "./src/app/services" ], "testMatch": [ "**/__tests__/**/.+(ts|tsx|js)","**/?(*.)+(spec|test).+(ts|tsx|js)" ], "transform": { "^.+\\.(ts|tsx)$": "ts-jest" }, }