{
"typescript": "^4.2.4",
"@types/jest": "^26.0.22",
"jest": "^26.6.3",
"ts-jest": "^26.5.5"
}
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
{
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
}
}
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${relativeFile}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
}
https://medium.com/@RupaniChirag/writing-unit-tests-in-typescript-d4719b8a0a40
https://github.com/ChiragRupani/TSUnitTestsSetup/tree/master/HelloJest