I have incorporated lint-staged along with Jest testing framework to solely test the files that have been altered since the last commit, following the instructions outlined in this blog.
Here is my current configuration:
"src/**/*.{ts}": [
"prettier --write",
"tslint --fix --project .",
"jest --bail --findRelatedTests",
"git add"
]
In addition to running tests on only changed files, I aim to generate a coverage report for these specific files. This requires listing the changed files in multiple places.
jest --bail --findRelatedTests <spaceSeparatedListOfSourceFiles> --collectCoverageFrom=<glob>
Can anyone guide me on how to restrict both testing and coverage reports to only modified files using lint-staged?