I've got just set up just fine, I can run jest and my unit tests are run. I've also get tsc-watch keeping an eye on my changes and compiling when I run yarn dev the below script in package.json is triggered.
"scripts": {
"dev": "tsc-watch --project . --outDir ./dist --onSuccess \"nodemon ./dist/app.js\"",
},
Is there some way I can have jest constantly watching at the same time, so if I break a test as I'm coding it will tell me immediately?
My jest.config.js looks like
module.exports = {
roots: ['<rootDir>/tests'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(/tests/.*|(\\.|/)(test))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}
and my tsconfig.js
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*"
]
}
},
"include": ["api/**/*"],
"exclude": ["node_modules", "tests/**/*"]
}