Skip to content
This repository has been archived by the owner. 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 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 bsclifton self-assigned this Feb 26, 2017
@bsclifton bsclifton requested review from bbondy and alexwykoff Feb 26, 2017
@bsclifton
Copy link
Member Author

bsclifton commented Feb 27, 2017

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

@NejcZdovc
Copy link
Member

NejcZdovc commented Feb 27, 2017

One that is also very strong is Codecov

@bsclifton bsclifton closed this Mar 1, 2017
@bsclifton bsclifton reopened this Mar 1, 2017
@bsclifton bsclifton added this to the 0.13.6 milestone Mar 1, 2017
…ge using istanbul.

Auditors: @alexwykoff, @bbondy

Fixes #6473
@bsclifton bsclifton force-pushed the bsc-unit-test-coverage branch from 42e1854 to 49fee91 Mar 10, 2017
@bsclifton
Copy link
Member Author

bsclifton commented Mar 10, 2017

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
0 of 3 checks passed
0 of 3 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@bsclifton bsclifton deleted the bsc-unit-test-coverage branch Mar 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.