I have jest.config.js as below:
module.exports = {
"roots": [
"<rootDir>/src"
],
"testMatch": [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)"
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
"testResultsProcessor": "jest-sonar-reporter",
"collectCoverage": true,
"collectCoverageFrom": [
"**/*.{ts,js}",
"!**/node_modules/**"
],
"coverageDirectory": "dist",
"coverageReporters": ["lcov"]
}
A report file test-report.xml
is generated in the project root directory. How can I make it to be saved in dist
directory?
Also you can configure it in jest
configuration in package.json
file
"jest": {
"coverageDirectory": "<rootDir>/reports",
}
According to your configuration a report file test-report.xml
is generated by jest-sonar-reporter
. You can change jest-sonar-reporter
output directory by adding the following section to package.json
:
"jestSonar": {
"reportPath": "dist"
}
Reference: https://github.com/3dmind/jest-sonar-reporter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With