How can I override the default output directory and file name jest-junit?
I would like to customise the output configuration of output when using Jest, but it still ends up in the default location, i.e. ./junit.xml
in the project root folder.
My configuration
In package.json:
"scripts": {
"test": "jest --ci --reporters=default --reporters=jest-junit"
},
"devDependencies": {
"jest": "^24.9.0",
"jest-junit": "^10.0.0",
}
In jest.config.js
module.exports = {
testMatch: [
'**/*.spec.js',
],
reporters: [
'default',
[ 'jest-junit', {
outputDirectory: 'test_reports',
outputName: 'jest-junit.xml',
} ]
]
};
Expected result:
- A file with the test result at
./test_reports/jest-junit.xml
Actual result:
- A file with the test result at the default
./junit.xml