diff options
author | winniehell <git@winniehell.de> | 2017-02-11 00:45:54 +0100 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2017-02-11 21:55:02 +0100 |
commit | bfb82f8a0d4d837a0472342c05de18c60037a2ea (patch) | |
tree | 717d307b4c840b57c91b223fefd32fd6c28279df /spec | |
parent | b48d30e4d27d2482f5517fc58751953d32f0ded6 (diff) | |
download | gitlab-ce-bfb82f8a0d4d837a0472342c05de18c60037a2ea.tar.gz |
Include all files with 0% coverage in report
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/test_bundle.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index 030d2de090a..ca707d872a4 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -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(); + } + } + }); + }); +}); |