Files
overleaf-cep/services/web/vitest.config.js
Andrew Rumble f1e788d9b3 Merge pull request #29967 from overleaf/ar/web-remove-mocha-unit-tests
[web] remove mocha unit tests

GitOrigin-RevId: eda753af3470dbd1f385cb0bc3f06d78ade8a764
2025-12-03 09:05:37 +00:00

52 lines
1.2 KiB
JavaScript

const { defineConfig } = require('vitest/config')
let reporterOptions = {}
if (process.env.CI && process.env.MOCHA_ROOT_SUITE_NAME) {
reporterOptions = {
reporters: [
'default',
[
'junit',
{
classnameTemplate: `${process.env.MOCHA_ROOT_SUITE_NAME}.{filename}`,
},
],
],
outputFile: 'data/reports/junit-vitest.xml',
}
}
module.exports = defineConfig({
test: {
setupFiles: ['./test/unit/bootstrap.mjs'],
globals: true,
isolate: false,
passWithNoTests: true, // in case there are no tests from one project or other in a module
projects: [
{
extends: true,
test: {
name: 'Parallel',
include: [
'modules/*/test/unit/**/*.test.mjs',
'test/unit/src/**/*.test.mjs',
],
exclude: ['**/*.sequential.test.mjs'],
fileParallelism: true,
},
},
{
extends: true,
test: {
name: 'Sequential',
include: [
'modules/*/test/unit/**/*.sequential.test.mjs',
'test/unit/src/**/*.sequential.test.mjs',
],
fileParallelism: false,
},
},
],
...reporterOptions,
},
})