1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-06 05:55:28 +00:00
bramw_baserow/web-frontend/jest.config.js
Jeremie Pardou-Piquemal 2f34b99fb9 Add enterprise plugin
2022-09-22 10:00:59 +02:00

43 lines
1.5 KiB
JavaScript

// Setting reporters on the command line does not work so enable via this env variable
// we have to set anyway when using the junit reporter in CI.
const junitReporterConfig = process.env.JEST_JUNIT_OUTPUT_DIR
? {
reporters: ['default', '<rootDir>/web-frontend/node_modules/jest-junit'],
}
: {}
module.exports = {
// The rootDir used by jest must be the root of the repository so the
// premium/enterprise tests and frontend code are contained within jest's rootDir.
// This is because:
// - Jest cannot collect coverage for files outside of its rootDir
// - Jest struggles to run tests which are outside of its rootDir.
rootDir: '..',
roots: [
'<rootDir>/web-frontend/',
'<rootDir>/premium/web-frontend',
'<rootDir>/enterprise/web-frontend',
],
moduleDirectories: ['<rootDir>/web-frontend/node_modules/'],
modulePaths: ['<rootDir>/web-frontend/node_modules/'],
projects: [
'<rootDir>/web-frontend/test/unit',
'<rootDir>/premium/web-frontend/test/unit',
'<rootDir>/enterprise/web-frontend/test/unit',
'<rootDir>/web-frontend/test/server',
],
coverageReporters: [
'text-summary',
['cobertura', { projectRoot: '/baserow/' }],
],
collectCoverageFrom: [
'<rootDir>/premium/web-frontend/modules/**/*.{js,Vue,vue}',
'<rootDir>/enterprise/web-frontend/modules/**/*.{js,Vue,vue}',
'<rootDir>/web-frontend/modules/**/*.{js,Vue,vue}',
'!**/node_modules/**',
'!**/.nuxt/**',
'!**/reports/**',
'!**/test/**',
'!**/generated/**',
],
...junitReporterConfig,
}