The answer is yes.
Got a super quick answer here:
https://github.com/salesforce/sfdx-lwc-jest/issues/128
to use:
https://github.com/MailOnline/jest-tap-reporter
I couldn't get it to work just configuring in package.json
but this did work:
"scripts": {
"test:unit": "sfdx-lwc-jest -- --reporters='jest-tap-reporter'"
},
On reflection I'm going to use the JUnit format via https://www.npmjs.com/package/jest-junit. So in `package.json':
"scripts": {
"test:unit": "sfdx-lwc-jest -- --reporters=default --reporters=jest-junit"
}
and then to run (inside https://claimvantage.github.io/sfdx-jenkins-shared-library/ but basically wrapped shell commands):
afterTestStage: { org ->
echo "${org.name} running LWC tests"
// Install LWC test runner and JUnit reporter; config is in package.json and perhaps dependency should be too
shWithStatus "npm install @salesforce/sfdx-lwc-jest --save-dev"
shWithStatus "npm install jest-junit --save-dev"
// Test result folder
sh "mkdir -p ${env.WORKSPACE}/tests/${env.BUILD_NUMBER}/${org.name}"
// Run tests - deliberately no status check so build doesn't fail immediately; klunky reporter option passing via environment variables
sh returnStatus: true, script: "JEST_JUNIT_OUTPUT_DIR='${env.WORKSPACE}/tests/${env.BUILD_NUMBER}/${org.name}' JEST_JUNIT_OUTPUT_NAME='test-result-lwc-junit.xml' npm run test:unit"
// Prefix class name with target org to separate the test results
sh returnStatus: true, script: "sed -i -- 's/classname=\"/classname=\"${org.name}./g' ${env.WORKSPACE}/tests/${env.BUILD_NUMBER}/${org.name}/test-result-lwc-junit.xml/"
}