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

code coverage #44

Open
j opened this issue Feb 8, 2013 · 4 comments
Open

code coverage #44

j opened this issue Feb 8, 2013 · 4 comments

Comments

@j
Copy link

j commented Feb 8, 2013

Is there a way to tie in code coverage?

Also, I'd like to tie both into jenkins and be able to fail builds if tests fail or if certain amount of lines aren't covered... Any ideas on the best way to do this?

@kmiyashiro
Copy link
Owner

Currently, no. I am planning on looking into integrating https://github.com/metaskills/mocha-phantomjs instead of our current phantom -> console system, theoretically it would support CI integration.

@geekdave
Copy link

For anyone who's interested, I forked this project to add "live" code-coverage enforcement via BlanketJS:
https://github.com/ModelN/grunt-blanket-mocha

Note that this differs from other implementations (such as ones that use Istanbul) which create physical instrumented copies of your source files to check coverage. Blanket does it in-memory.

This also allows you to fail the build if a certain minimum coverage threshold is not met. I'm currently using this with TravisCI as shown in one of my projects here: https://travis-ci.org/ModelN/backbone.geppetto/builds/9711973

This also integrates nicely with Jenkins as we're doing on an internal project at my company.

@dpehrson
Copy link

dpehrson commented Nov 1, 2013

Is there any movement on this? Is it possible to integrate @geekdave's changes into grunt-mocha proper?

@geekdave
Copy link

geekdave commented Nov 1, 2013

At this point it's probably better to leave our projects as separate, since they have different goals. I've used my fork on a few projects now, and I've been adding new features frequently, so frankly I'd prefer to stay in control. :)

I wrote a blog about it here, if you're interested in learning more: http://www.geekdave.com/2013/08/02/automated-code-coverage-enforcement-for-mocha-using-grunt-and-blanket/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants