Commit 374f991d authored by Annabel Gray's avatar Annabel Gray

Merge branch '48912-vue-files-without-tests-missing-in-coverage-report-ee' into 'master'

Include Vue files without tests in coverage report (EE-port)

Closes gitlab-ce#48912

See merge request gitlab-org/gitlab-ee!6478
parents 804fc74e 48cd01a8
......@@ -173,8 +173,8 @@ if (process.env.BABEL_ENV === 'coverage') {
describe('Uncovered files', function() {
const sourceFilesContexts = [
require.context('~', true, /\.js$/),
require.context('ee', true, /\.js$/),
require.context('~', true, /\.(js|vue)$/),
require.context('ee', true, /\.(js|vue)$/),
];
const allTestFiles = testContexts.reduce((accumulator, context) =>
accumulator.concat(context.keys()), []);
......@@ -184,7 +184,7 @@ if (process.env.BABEL_ENV === 'coverage') {
sourceFilesContexts.forEach(context => {
context.keys().forEach(path => {
// ignore if there is a matching spec file
if (allTestFiles.indexOf(`${path.replace(/\.js$/, '')}_spec`) > -1) {
if (allTestFiles.indexOf(`${path.replace(/\.(js|vue)$/, '')}_spec`) > -1) {
return;
}
......
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