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

Enable unit test code coverage reporting #215

Merged
merged 1 commit into from
Oct 21, 2017
Merged

Enable unit test code coverage reporting #215

merged 1 commit into from
Oct 21, 2017

Conversation

lovell
Copy link
Contributor

@lovell lovell commented Oct 19, 2017

Hi Brandon, I was bitten by #197 and noticed that the accepted fix in #200 did not include a test that could have caught the problem.

I tried to generate the unit test code coverage report for this module with grunt coverage but received a "html-cov" reporter not found error.

It appears mocha dropped support for html-cov reporting in v3.0.0.

Given this module does not appear to require any of the features of Mocha v3, the quickest way to generate a coverage report was to downgrade Mocha to the most recent v2.x version.

With the small change in this PR it is now possible to use npm run coverage (or yarn coverage) to generate full code coverage reports.

Whilst "downgrading" Mocha may feel like a step backwards, the ability to generate a code coverage report provides a big step forwards in terms of confidence-building in this useful module.

If there's interest, I could take a look at modernising the test tooling to use something like nyc, which provides more useful statistics around branch coverage.

Cheers,
Lovell

Publicise this feature via a 'npm run coverage' script.
@brandongoode
Copy link
Contributor

@lovell -- Thanks for the offer to modernize the testing. I would gladly take you up on the offer. One of my other repos has already been moved over to istanbul and uses https://coveralls.io for coverage tracking.

@brandongoode brandongoode merged commit 95e6ad5 into dynamoose:master Oct 21, 2017
@lovell lovell deleted the enable-unit-test-coverage-reporting branch October 21, 2017 16:42
@fishcharlie fishcharlie mentioned this pull request Mar 10, 2018
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.

2 participants