summaryrefslogtreecommitdiff
path: root/jest.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'jest.config.js')
-rw-r--r--jest.config.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/jest.config.js b/jest.config.js
index d07c034e88e..fe05141dfd7 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -55,6 +55,14 @@ if (IS_EE) {
collectCoverageFrom.push(rootDirEE.replace('$1', '/**/*.{js,vue}'));
}
+const coverageDirectory = () => {
+ if (process.env.CI_NODE_INDEX && process.env.CI_NODE_TOTAL) {
+ return `<rootDir>/coverage-frontend/jest-${process.env.CI_NODE_INDEX}-${process.env.CI_NODE_TOTAL}`;
+ }
+
+ return '<rootDir>/coverage-frontend/';
+};
+
// eslint-disable-next-line import/no-commonjs
module.exports = {
clearMocks: true,
@@ -62,7 +70,7 @@ module.exports = {
moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper,
collectCoverageFrom,
- coverageDirectory: '<rootDir>/coverage-frontend/',
+ coverageDirectory: coverageDirectory(),
coverageReporters: ['json', 'lcov', 'text-summary', 'clover'],
cacheDirectory: '<rootDir>/tmp/cache/jest',
modulePathIgnorePatterns: ['<rootDir>/.yarn-cache/'],