Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Added npm task for getting unit test coverage #7391

Merged
merged 2 commits into from
Mar 10, 2017
Merged

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Feb 26, 2017

Test plan

  1. git clone git@github.com:brave/browser-laptop.git
  2. cd browser-laptop
  3. npm run unittest-cov
  4. you should see a very nice color coded dump of all files and their coverage (see picture below)

Description

Added new unittest-cov npm task which reports (via CLI) code coverage using istanbul.

Auditors: @alexwykoff, @bbondy

Fixes #6473

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Notes

  • common options were moved to test/mocha.opts
  • unit tests work great (with and without coverage)
  • webdriver tests should not be impacted, but the npm task was edited. Let's watch tests on this one
  • we'll want to understand more about coverage, but this should be a good start

Example output

screen shot 2017-02-26 at 12 26 30 am

@bsclifton
Copy link
Member Author

Now that we can get coverage, we can look at services like these (which are free for open source projects!):

@NejcZdovc
Copy link
Contributor

One that is also very strong is Codecov

@bsclifton bsclifton force-pushed the bsc-unit-test-coverage branch from 42e1854 to 49fee91 Compare March 10, 2017 19:19
@bsclifton
Copy link
Member Author

I re-ran failing tests; the ones which fail are also failing in master (they are not because of this). I did take a few minutes to make the alert tests more reliable.

Since this is very low impact and haven't gotten a review, I'll go ahead and merge

@bsclifton bsclifton merged commit e1ed983 into master Mar 10, 2017
@bsclifton bsclifton deleted the bsc-unit-test-coverage branch March 10, 2017 21:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants