currently I am using the standard testRegex logic to run my tests
"jest": {
"moduleFileExtensions": [
"ts",
"js"
],
"transform": {
"^.+\\.ts?$": "<rootDir>/node_modules/ts-jest/preprocessor.js",
"^.+\\.js?$": "babel-jest"
},
"testRegex": "/tests/.*\\.(ts|js)$"
}
But I would like to split them using specific paths
test-client "testRegex": "/tests/client/.*\\.(ts|js)$"
test-server "testRegex": "/tests/server/.*\\.(ts|js)$"
I see that there is a, option --runTestsByPath. but I cannot find any example of it
feedback welcome
UPDATE
I tried to add the script
"test-client": "jest --runTestsByPath \"tests/client/\""
with a test file : tests/client/test.spec.js
but got an error :
$ jest --runTestsByPath "tests/client/"
No tests found
No files found in /Users/../myapp.
Make sure Jest's configuration does not exclude this directory.