jest-coverage-report-action
jest-coverage-report-action copied to clipboard
Parse threshold information from jest configuration in 'package.json'
Idea
Action should parse threshold information not only from jest.config.*
files, but also from package.json
.
Description
The schema of jest configuration in package.json
file is described here
Additional context
Originally described in #223 issue.
This would be great to have @ArtiomTr - adding to it, maybe there's a way to configure the path to the jest.config.*
file so that one can also use this action on multiple directories within a npm workspace monorepo setup?
Thanks for all your work with this! Cheers
Hello @tobiasbueschel :wave:,
There is an option working-directory
. Is this option what you are looking for?
I'm glad this has been suggested as it's a problem I'm encountering. Specifically, in my case, the config in package.json
is for a Create React App:
{
"jest": {
"watchPathIgnorePatterns": [
"<rootDir>\\/src\\/(.+\\/)+.+\\.stories\\.tsx"
],
"collectCoverageFrom": [
"<rootDir>/src/pages/**/*.+(ts|tsx|js)",
"<rootDir>/src/components/**/*.+(ts|tsx|js)",
"!<rootDir>/src/**/*.style.+(tsx)",
"!<rootDir>/src/**/*.stories.+(tsx)",
"!<rootDir>/src/**/*.index.+(tsx)"
],
"coverageReporters": [
"text",
"text-summary"
]
}
}
@grahammcculloch,
Sorry, I just now realized how vague this issue is. This issue is not about parsing jest configuration, it is about taking threshold information from the jest configuration, because action should show clear message, when threshold values are not met.
This action don't use any jest configuration to actually run tests, it simply runs the script, which is specified as test-script
input (here is the docs link). So if jest not takes information from package.json
file, it is most likely that something is wrong with your test-script
option.
+1 I'm trying to use this action in a NestJS project , all jest configuration is in package.json
bump +1 for CRA