node --version
nvm install node
npm init -y
npm install -g yarn
yarn add typescript jest @types/jest ts-node ts-jest
npx tsc --init
{
"compilerOptions": {
"incremental": true,
"target": "es2016",
"module": "commonjs",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true
},
"include": [
"src",
"test"
]
}
mkdir src test
npx ts-jest config:init
"scripts": {
"main": "tsc && node ./dist/main",
"test": "tsc && jest ./dist/test"
},
npm run main
npx ts-node src/main.ts
npm run test
npx jest