Istanbul: A JavaScript code coverage tool written in JS
gotwarlost.github.io
Istanbul: A JavaScript code coverage tool written in JS
1–10 of 18 posts
Re: Istanbul: A JavaScript code coverage tool written in JS
#2This is a brilliant tool for those of us who test JavaScript. A bit of a hack, but it seems to work.
It's also a reason why browsers should allow some sort of tracing API for JavaScript. I know V8 and Firefox do not expose the interface because they couldn't think of a decent enough use case to justify exposing the surface area of this code. This is the use case.
Re: Istanbul: A JavaScript code coverage tool written in JS
#3In case it's useful for anyone, here is a gist of a gulpfile I use to use Istanbul to instrument my Node.js app, then run tests with Mocha and output the results:
Re: Istanbul: A JavaScript code coverage tool written in JS
#4For rails projects, if you use the teaspoon gem as test runner (https://github.com/modeset/teaspoon), then you can easily get istanbul based coverage reports as well. It's a good way to see which paths your js tests take in a large project and pinpoint untested code.
Re: Istanbul: A JavaScript code coverage tool written in JS
#5Why did you name it Istanbul?
Re: Istanbul: A JavaScript code coverage tool written in JS
#6why is this popping up now? its quite an old project at this point.
Re: Istanbul: A JavaScript code coverage tool written in JS
#7sample LCOA Report links is broken, http://gotwarlost.github.io/istanbul/public/coverage/std-lco...
Re: Istanbul: A JavaScript code coverage tool written in JS
#8Why did you name it Istanbul?
> Why the funky name?
> Since all the good ones are taken. Comes from the loose association of ideas across coverage, carpet-area coverage, the country that makes good carpets and so on...
Re: Istanbul: A JavaScript code coverage tool written in JS
#9I use this all the time. This is the command I use for coverage with mocha:
./node_modules/istanbul/lib/cli.js cover -- ./node_modules/mocha/bin/_mocha -R spec
Always in my Makefile as make test-cov
Re: Istanbul: A JavaScript code coverage tool written in JS
#10Ah that reminds me I wrote a coverage server for istanbul in node.js. It allows testem to send coverage statics across mutliple tests/runs to reported on. It's part of a whole test running package that I'm working on open sourcing that will allow testem (which is a great test runner if you don't mind running all of your tests in one big session) to run multiple suites of tests. For instance if you have a order app and an client management app and you want separate test runs to avoid any namespace collisions the project allows you to define handlebars based templates to define your suites and run each suite with testem one at a time. Anyway here is a gist of the coverage server if it's useful to anyone:
https://gist.github.com/jaegerpicker/95c3900426d55eb9b857