в настоящее время я использую стандартную логику testRegex для запуска моих тестов
"jest": {
"moduleFileExtensions": [
"ts",
"js"
],
"transform": {
"^.+\\.ts?$": "<rootDir>/node_modules/ts-jest/preprocessor.js",
"^.+\\.js?$": "babel-jest"
},
"testRegex": "/tests/.*\\.(ts|js)$"
}
Но я бы хотел разделить их, используя конкретные пути
test-client "testRegex": "/tests/client/.*\\.(ts|js)$"
test-server "testRegex": "/tests/server/.*\\.(ts|js)$"
Я вижу, что есть опция --runTestsByPath. но я не могу найти ни одного примера из этого
обратная связь приветствуется
UPDATE
Я пытался добавить скрипт
"test-client": "jest --runTestsByPath \"tests/client/\""
с тестовым файлом: tests / client / test.spec.js
но получил ошибку:
$ jest --runTestsByPath "tests/client/"
No tests found
No files found in /Users/../myapp.
Make sure Jest's configuration does not exclude this directory.