Commit bfb82f8a authored by winniehell's avatar winniehell

Include all files with 0% coverage in report

parent b48d30e4
...@@ -42,3 +42,38 @@ testsContext.keys().forEach(function (path) { ...@@ -42,3 +42,38 @@ testsContext.keys().forEach(function (path) {
}); });
} }
}); });
// workaround: include all source files to find files with 0% coverage
// see also https://github.com/deepsweet/istanbul-instrumenter-loader/issues/15
describe('Uncovered files', function () {
// the following files throw errors because of undefined variables
const troubleMakers = [
'./blob_edit/blob_edit_bundle.js',
'./cycle_analytics/components/stage_plan_component.js',
'./cycle_analytics/components/stage_staging_component.js',
'./cycle_analytics/components/stage_test_component.js',
'./diff_notes/components/jump_to_discussion.js',
'./diff_notes/components/resolve_count.js',
'./merge_conflicts/components/inline_conflict_lines.js',
'./merge_conflicts/components/parallel_conflict_lines.js',
'./network/branch_graph.js',
];
const sourceFiles = require.context('~', true, /^\.\/(?!application\.js).*\.(js|es6)$/);
sourceFiles.keys().forEach(function (path) {
// ignore if there is a matching spec file
if (testsContext.keys().indexOf(`${path.replace(/\.js(\.es6)?$/, '')}_spec`) > -1) {
return;
}
it(`includes '${path}'`, function () {
try {
sourceFiles(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