jest-html-reporters
jest-html-reporters copied to clipboard
jenkins build error : No test report files were found. Configuration error?
Describe the bug
Error jenkins build error : No test report files were found. Configuration error?
is thrown by jenkins when we skip unit test step in jenkins and it fails the build. I couldn't find a variable which allows empty or no test report files so that no error is thrown. Is there any plan to add a variable which will allow the empty or no test report files?
To Reproduce Steps to reproduce the behavior:
- run a jenkins build while skipping unit test step so that no test report file is generated. Above error will be thrown in this scenario.
Expected behavior There should be a variable which will allow empty test report files and build should not fail when there's no test report file generated if that variable value is true.
Hi @meta-dipanshu-sharma , I am not familiar with Jenkins, but seems this was not related to this project, we did never throw such an error.
I think this is related to the junit.xml output location. After adding this report generator, the junit.xml is getting generated in the root folder. This config in jest.conf.js fixed it for me:
...
reporters: [
'default',
['./node_modules/jest-junit', {
outputDirectory: 'build/report/tests'
}],
['./node_modules/jest-html-reporters', {
publicPath: 'build/report/jest-report',
pageTitle: 'Jest Test Report'
}]
],
...
Closed due to long time no response. feel free to reopen.