mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
* [web] override timeout for a specific template * [web] fix junit integration for vitest * [web] consolidate on JUNIT_ROOT_SUITE_NAME * [web] fix unit test GitOrigin-RevId: 3ba865e4b9c090c7bf8e07dc3d81e9bcee20d821
58 lines
1.3 KiB
JavaScript
58 lines
1.3 KiB
JavaScript
const { defineConfig } = require('vitest/config')
|
|
|
|
let reporterOptions = {}
|
|
if (process.env.CI && process.env.JUNIT_ROOT_SUITE_NAME) {
|
|
reporterOptions = {
|
|
reporters: [
|
|
'default',
|
|
[
|
|
'junit',
|
|
{
|
|
classnameTemplate: `${process.env.JUNIT_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',
|
|
],
|
|
sequence: {
|
|
groupOrder: 2,
|
|
},
|
|
exclude: ['**/*.sequential.test.mjs'],
|
|
fileParallelism: true,
|
|
},
|
|
},
|
|
{
|
|
extends: true,
|
|
test: {
|
|
name: 'Sequential',
|
|
sequence: {
|
|
groupOrder: 1,
|
|
},
|
|
include: [
|
|
'modules/*/test/unit/**/*.sequential.test.mjs',
|
|
'test/unit/src/**/*.sequential.test.mjs',
|
|
],
|
|
fileParallelism: false,
|
|
},
|
|
},
|
|
],
|
|
...reporterOptions,
|
|
},
|
|
})
|