Include all files with 0% coverage in report
This commit is contained in:
parent
b48d30e4d2
commit
bfb82f8a0d
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue