vitest.config.unit.cjs 505 B

12345678910111213141516171819202122232425
  1. const { defineConfig } = require('vitest/config')
  2. let reporterOptions = {}
  3. if (process.env.CI) {
  4. reporterOptions = {
  5. reporters: [
  6. 'default',
  7. [
  8. 'junit',
  9. {
  10. classnameTemplate: `Unit tests.{filename}`,
  11. },
  12. ],
  13. ],
  14. outputFile: 'reports/junit-vitest-unit.xml',
  15. }
  16. }
  17. module.exports = defineConfig({
  18. test: {
  19. include: ['test/unit/js/**/*.test.{js,ts}'],
  20. setupFiles: ['./test/setup.js'],
  21. isolate: false,
  22. ...reporterOptions,
  23. },
  24. })