Commit 92da6112 authored by Winnie Hellmann's avatar Winnie Hellmann

Include ee/ in Jest coverage report

parent 6c1f03fe
...@@ -40,6 +40,8 @@ const moduleNameMapper = { ...@@ -40,6 +40,8 @@ const moduleNameMapper = {
'^spec/test_constants$': '<rootDir>/spec/frontend/helpers/test_constants', '^spec/test_constants$': '<rootDir>/spec/frontend/helpers/test_constants',
}; };
const collectCoverageFrom = ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'];
if (IS_EE) { if (IS_EE) {
const rootDirEE = '<rootDir>/ee/app/assets/javascripts$1'; const rootDirEE = '<rootDir>/ee/app/assets/javascripts$1';
Object.assign(moduleNameMapper, { Object.assign(moduleNameMapper, {
...@@ -47,6 +49,8 @@ if (IS_EE) { ...@@ -47,6 +49,8 @@ if (IS_EE) {
'^ee_component(/.*)$': rootDirEE, '^ee_component(/.*)$': rootDirEE,
'^ee_else_ce(/.*)$': rootDirEE, '^ee_else_ce(/.*)$': rootDirEE,
}); });
collectCoverageFrom.push(rootDirEE.replace('$1', '/**/*.{js,vue}'));
} }
// eslint-disable-next-line import/no-commonjs // eslint-disable-next-line import/no-commonjs
...@@ -54,7 +58,7 @@ module.exports = { ...@@ -54,7 +58,7 @@ module.exports = {
testMatch, testMatch,
moduleFileExtensions: ['js', 'json', 'vue'], moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper, moduleNameMapper,
collectCoverageFrom: ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'], collectCoverageFrom,
coverageDirectory: '<rootDir>/coverage-frontend/', coverageDirectory: '<rootDir>/coverage-frontend/',
coverageReporters: ['json', 'lcov', 'text-summary', 'clover'], coverageReporters: ['json', 'lcov', 'text-summary', 'clover'],
cacheDirectory: '<rootDir>/tmp/cache/jest', cacheDirectory: '<rootDir>/tmp/cache/jest',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment