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

Include Vue files without tests in coverage report

Closes #48912

See merge request gitlab-org/gitlab-ce!20431
This commit is contained in:
Annabel Gray 2018-07-12 20:10:59 +00:00
commit b8450b8bd7

View file

@ -166,13 +166,13 @@ if (process.env.BABEL_ENV === 'coverage') {
];
describe('Uncovered files', function() {
const sourceFiles = require.context('~', true, /\.js$/);
const sourceFiles = require.context('~', true, /\.(js|vue)$/);
$.holdReady(true);
sourceFiles.keys().forEach(function(path) {
// ignore if there is a matching spec file
if (testsContext.keys().indexOf(`${path.replace(/\.js$/, '')}_spec`) > -1) {
if (testsContext.keys().indexOf(`${path.replace(/\.(js|vue)$/, '')}_spec`) > -1) {
return;
}