Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10514 fix coverage - 3 #12

Merged
merged 4 commits into from
Sep 20, 2017
Merged

10514 fix coverage - 3 #12

merged 4 commits into from
Sep 20, 2017

Conversation

michalstocki
Copy link

@michalstocki michalstocki commented Sep 20, 2017

Changes:

  1. To get rid of empty lines reported from reports created via nyc (integration tests) I simply changed --reporter=lcov to --reporter=clover
  2. The hard part was when I realized that the built-in coverage reporting feature of Jest framework (http://facebook.github.io/jest/) is also reporting empty lines as uncovered (We use it for unit tests – those importing tested function explicitly). I tried to change format to clover but it didn’t helped. I realized that line numbers in the coverage report are referencing the JS output instead of the TypeScript souce. Hopefully I found the issue with a detailed description how to make Jest coverage working with TypeScript. Source map support jestjs/jest#336 (comment)
  3. Finally I turn off the TypeScript support in Jest (when run on CI) and let it calculate coverage for JS files. Then I use reamp-istanbul via command line to remap the JS coverage to the TS source:
remap-istanbul -i coverage/coverage-final.json -o coverage/clover.xml -t clover

To get rid of empty lines marked as red in the Codecov preview
@bauerpl
Copy link

bauerpl commented Sep 20, 2017

Codecov Report

Merging #12 into master will increase coverage by 24.35%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #12       +/-   ##
===========================================
+ Coverage   68.23%   92.59%   +24.35%     
===========================================
  Files           6        6               
  Lines          85       54       -31     
  Branches        7        4        -3     
===========================================
- Hits           58       50        -8     
+ Misses         25        3       -22     
+ Partials        2        1        -1
Flag Coverage Δ
#unittests ?
#uxpin_code_cli 92.59% <ø> (?)
Impacted Files Coverage Δ
...kages/uxpin-code-cli/src/components/isComponent.ts 100% <0%> (ø) ⬆️
...ackages/uxpin-code-cli/src/utils/asynchronousFS.ts 89.47% <0%> (+1.01%) ⬆️
...ages/uxpin-code-cli/src/getDesignSystemMetadata.ts 50% <0%> (+25%) ⬆️
...rc/components/getDesignSystemComponentLocations.ts 95.23% <0%> (+37.66%) ⬆️
...kages/uxpin-code-cli/src/getDesignSystemSummary.ts 100% <0%> (+42.85%) ⬆️
packages/uxpin-code-cli/src/index.ts 100% <0%> (+66.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9c6000...ce0e529. Read the comment docs.

Copy link
Contributor

@jaroslawsawicki jaroslawsawicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:notbad:

@michalstocki michalstocki merged commit d6c830a into master Sep 20, 2017
@michalstocki michalstocki deleted the 10514-fix-coverage branch September 20, 2017 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants