I'm using lint-staged with Jest testing framework to test only changed files from last commit as described in this blog.
My configuration is as below:
"src/**/*.{ts}": [
"prettier --write",
"tslint --fix --project .",
"jest --bail --findRelatedTests",
"git add"
]
I also want to generate coverage-report for only changed files. To do this, I have to put list of changed files in multiple places.
jest --bail --findRelatedTests <spaceSeparatedListOfSourceFiles> --collectCoverageFrom=<glob>
Using lint-staged, how can I limit both test and coverage-report only for changed files?