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

Add npm alias scripts for generating html cov report locally #3366

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

cgewecke
Copy link
Collaborator

@cgewecke cgewecke commented Feb 5, 2020

Description

Per comment 3325, PR adds some npm alias scripts that let you generate an html coverage report locally.

npm run test:cov will run the unit and client tests, generating an aggregate coverage report that can be viewed in a browser by opening web3.js/coverage/index.html.

Have left out test:e2e:ens because it installs stuff in the project root - e.g it's designed to run in CI rather than locally.

You can also combine commands to generate coverage more selectively if you're trying to look at the result of specific tests. e.g This will generate html coverage for geth:insta tests only:

npm run cov:clean 
npm run test:e2e:geth:insta 
npm run cov:html

Example:

Screen Shot 2020-02-05 at 3 05 49 PM

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success and extended the tests if necessary.
  • I ran npm run build-all and tested the resulting file/'s from dist folder in a browser.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have tested my code on the live network.

@cgewecke cgewecke added 1.x 1.0 related issues Review Needed Maintainer(s) need to review labels Feb 5, 2020
@cgewecke cgewecke requested a review from nivida February 5, 2020 23:24
@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.435% when pulling 0a10f77 on test/local-coverage into f5f7a42 on 1.x.

Copy link
Contributor

@nivida nivida left a comment

Choose a reason for hiding this comment

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

LGTM! Well described PR and a smart solution great!

@nivida nivida added QA and removed Review Needed Maintainer(s) need to review labels Feb 6, 2020
@nivida
Copy link
Contributor

nivida commented Feb 6, 2020

@cgewecke I will extend the checklist in the PR template with the following addition:

- [ ] I have executed ``npm run test:cov`` and my test cases do cover all lines and branches. 

@nivida nivida merged commit 620c0ba into 1.x Feb 6, 2020
@nivida nivida deleted the test/local-coverage branch February 28, 2020 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants