Commit 46f2255d authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'winh-remove-karma-coverage-hack' into 'master'

Remove coverage hack from Karma

See merge request gitlab-org/gitlab!21386
parents bd3aa45c f102a661
import axios from '~/lib/utils/axios_utils';
import '~/performance_bar/components/performance_bar_app.vue';
import performanceBar from '~/performance_bar';
import PerformanceBarService from '~/performance_bar/services/performance_bar_service';
......
......@@ -165,48 +165,3 @@ describe('test errors', () => {
}
});
});
// if we're generating coverage reports, make sure to include all files so
// that we can catch files with 0% coverage
// see: https://github.com/deepsweet/istanbul-instrumenter-loader/issues/15
if (process.env.BABEL_ENV === 'coverage') {
// exempt these files from the coverage report
const troubleMakers = [
'./pages/admin/application_settings/general/index.js',
'./geo_designs/index.js',
];
describe('Uncovered files', function() {
const sourceFilesContexts = [require.context('~', true, /\.(js|vue)$/)];
if (process.env.IS_EE) {
sourceFilesContexts.push(require.context('ee', true, /\.(js|vue)$/));
}
const allTestFiles = testContexts.reduce(
(accumulator, context) => accumulator.concat(context.keys()),
[],
);
$.holdReady(true);
sourceFilesContexts.forEach(context => {
context.keys().forEach(path => {
// ignore if there is a matching spec file
if (allTestFiles.indexOf(`${path.replace(/\.(js|vue)$/, '')}_spec`) > -1) {
return;
}
it(`includes '${path}'`, function() {
try {
context(path);
} catch (err) {
if (troubleMakers.indexOf(path) === -1) {
expect(err).toBeNull();
}
}
});
});
});
});
}
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