JUnit Reporter was removed?
Describe the bug
It looks to me like JUnit reporting has broken? What is odd is that the CoverageReporter type actually has "junit" removed as an option, which implies to me that this was intentional?
But then in the documentation, for instance here https://vitest.dev/config/#reporters, "junit" is still referenced as being available.
I added a very basic StackBlitz example that reproduces this issue.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-es4cbi?file=package.json
I created a very basic reproduction in the StackBlitz above.
All it does is set junit as a reporter in the config, and you can see that it fails.
System Info
System:
OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Memory: 11.39 GB / 15.51 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.1/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
npmPackages:
@vitest/coverage-c8: ^0.28.5 => 0.28.5
@vitest/coverage-istanbul: ^0.28.5 => 0.28.5
@vitest/ui: ^0.28.5 => 0.28.5
vite: ^4.1.4 => 4.1.4
vitest: ^0.28.5 => 0.28.5
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.
vitest.dev/config/#reporters references reporters option, not coverage.reporters. If you want to set Vitest reporter as junit, use reporters configuration option:
// vitest.config.mjs
export default {
test: {
reporters: ['junit']
}
}
Oof, that was a dumb mistake. Sorry for the confusion and I appreciate the response. I'll mark this as closed
I did the same mistake and end up here. For me the confusion came from this snippet in the documentation: https://vitest.dev/guide/coverage.html#coverage-setup which uses coverage.reporters, so I thought I should use it as well for junit