-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add html-cov reporter #10
Comments
Done, could you tell me how you instrument mocha-phantomjs with |
Ok, will try. Then you just run phantomjs mocha-phantomjs.coffee http://localhost:3000/ json-cov and recieve coverage report in JSON format. There is a script to apply json report to your src files and recive nice html output. Can't find it now, will attach later. Currently html-cov doestn't work in mocha-phantomjs. before it will start to work you need to fix a few things:
|
Mocha doesn't have to be patched to have access to fs, Jade, stdout etc to make this work. Instead, If you can get jade working inside of PhantomJS, the code goes something like the following. You'll also need the templates/ folder from Mocha for the Jade templates.
I, however, was unable to get Jade working in PhantomJS as A quick workaround via an external JS file gets the job done: buildHTML.js:
Dump the templates/ folder from Mocha next to buildHTML.js and run the following command:
And coverage.html contains all the good stuff. |
@lazd thanks. |
created an npm binary json2htmlcov from @lazd 's buildHTML.js and templates/ folder from Mocha |
@yiwang it's not a good idea for using |
PhantomJS does not have process/stream support. |
@metaskills it's not for PhantomJS, it's a command for pipe. |
Well in this thread we are talking about PhantomJS and you mentioned how we use /dev/stdin which is the only thing we can. I am having a hard time threading your comments in if you both talking about PhantomJS and not. |
@metaskills my thread is a reply to @yiwang , what he did is a binary command, it has nothing to do with PhantomJS, and it would be better to do it with process and stream. I am sorry for the misleading. |
Version v3.0.0 is out which requires PhantomJS 1.9.1 with proper stream support. Please test this and let me know. |
I've tested HTMLCov with PhantomJS 1.9.1 and it's still Failed to start mocha. |
@princed Mine works well on html-cov: https://github.com/lepture/mocha-browser And you can even send coverage to coverall.io, take an example: https://github.com/aralejs/class |
@lepture Can you make a pull request to this project with any fixes you would like to see? |
@metaskills Are you sure? This will change a lot of code. I'll have a try. |
Will it? I would be interested in knowing what it takes. Open to ideas. |
@lepture Oh, I did this through grunt-mocha-phantomjs, so some issue are probably there. |
Closing this very old issue. If you need coverage, checkout mocha-phantomjs-istanbul or using blanket.js with hooks (see #99) |
LGTM. 👍 |
Hi, thanks for the great tool.
Can you add support of html-cov/json-cov reporters from mocha.
Thanks
The text was updated successfully, but these errors were encountered: