How to use jest-sonar-reporter? In config.json we were using "testResultsProcessor": "/config/jest/resultsProcessor":
resultsProcessor.js
module.exports = (results) => {
process.env.TEST_REPORT_PATH = root('reports/unit')
process.env.JEST_SUITE_NAME = 'React Unit Tests'
process.env.JEST_JUNIT_OUTPUT = root('reports/unit/junit.xml')
require(root('node_modules/jest-sonar-reporter/index')).apply(this, [results])
require(root('node_modules/jest-junit/index')).apply(this, [results])
// add any other processor you need
return results
}
this was working fine when we were using "jest": "^21.2.1",
but after updating Jest to "jest": "^26.1.0",
as per documentation...
"reporters": [ "default",[
"jest-junit", {
"outputDirectory":"reports/unit",
"suiteName": "ANZ-React-BoilerPlate Unit Tests",
"outputName": "junit.xml"
}]],
jest-junit is working fine but how to support jest-sonar-reporter?