vitest.config.js 657 B

1234567891011121314151617181920212223242526272829
  1. const { defineConfig } = require('vitest/config')
  2. let reporterOptions = {}
  3. if (process.env.CI && process.env.MOCHA_ROOT_SUITE_NAME) {
  4. reporterOptions = {
  5. reporters: [
  6. 'default',
  7. [
  8. 'junit',
  9. {
  10. classnameTemplate: `${process.env.MOCHA_ROOT_SUITE_NAME}.{filename}`,
  11. },
  12. ],
  13. ],
  14. outputFile: 'data/reports/junit-vitest.xml',
  15. }
  16. }
  17. module.exports = defineConfig({
  18. test: {
  19. include: [
  20. 'modules/*/test/unit/**/*.test.mjs',
  21. 'test/unit/src/**/*.test.mjs',
  22. ],
  23. setupFiles: ['./test/unit/vitest_bootstrap.mjs'],
  24. globals: true,
  25. isolate: false,
  26. ...reporterOptions,
  27. },
  28. })