-
Notifications
You must be signed in to change notification settings - Fork 787
Configuring istanbul with mocha #44
Comments
So there are two issues with the command you are running:
To fix this, use:
At this point, mocha will at least honor the options but it still won't provide coverage. That's because the So what you need is:
At this point everything should work. Let me know how it goes. |
Yes, this worked perfectly. Thanks so much. |
Thank you for adding this, been trying to find a good guide on how to achieve this combo |
I have another issue similar with this. How to send |
You can't directly do this with the Assuming the original command was:
turn it into:
|
Thanks, it helped partially, but now I get
I tried to run istanbul with
|
Did you try adding a |
Yeah, but the feeling that it disappears. All my files have |
You are most likely using a version of istanbul that does not handle file level strict mode correctly. Please use the harmony branch of this source tree to get the correct version. This also depends on the harmony branch of the esprima source tree so you will get a consistent set of dependencies. Not all es6 constructs are supported by the tools at this point so you may still have issues. Let me know what you find. |
All this time I used the harmony branch. And all my files have
|
I can't seem to get
|
@Qard - that actually looks like the instrumenter emitted some bad code. Is there a way you can share the users.js file with me? Or if you could provide a reproducible test case that would be great too. |
Awesome! |
as suggested here gotwarlost/istanbul#44
Hi, I am trying to use Istanbul but I am getting following error:- C:\Users\asrivastava1\AppData\Roaming\npm_mocha.CMD:1 SyntaxError: Unexpected token ILLEGAL Can you please guide me what am I doing wrong |
Using |
Yeah I just figured that if I use following command then it does run :- |
Thank you, #44 also solved my problem. In Windows 7, I just use |
hey @gotwarlost, i'm on osx 10 and running the following script for a simple express app via
what's the best way to debug the reason that coverage.json is not being generated? curious b/c the following does generate a coverage.json, as well as, the CLI summary output:
|
See: gotwarlost/istanbul#44 Now karl can be used with node 0.12 and later again
See: gotwarlost/istanbul#44 Now kimbu can be used with node 0.12 and later
See: gotwarlost/istanbul#44 Now krew can be used with node 0.12 and later
Hi Team, istanbul cover C:\Users\user_sam\AppData\Roaming\npm\node_modules\mocha\bin\mocha -- -R specD:\BaseRepo3\FirstNodejsWebApp>istanbul cover D:\KBaseRepo3\FirstNodejsWebApp\node_modules\mocha\bin_mocha -- -R spec KB unit test 8 passing (785ms) No coverage information was collected, exit without writing coverage informationPlease help!! |
@Om-sudhir try linking to the |
Just saying - it would be a lot cooler if mocha tests could be run with the plain old Node executable. |
@ORESoftware you can use https://github.com/bcoe/nyc for that and it works really well! |
@xjamundx thanks. My problem with istanbul is it does not return any coverage info. "No coverage information was collected, exit without writing coverage information." I've just installed nyc and it works for me. Now I got needed info within ".nyc_output", and if I run |
I'm stumped. I'm running
The tests execute exactly as expected. When I execute the coverage script, though, I always get an unknown option error:
I've tried each of the following:
What am I doing wrong here? |
Argh. Punitive headslap. I just realized someone had put the flag back in
|
* don't try to run npm under istanbul * use _mocha instead of mocha because gotwarlost/istanbul#44 (comment) Also: * write a text report for better travis * On jenkins, clear out old coverage reports so that we don't pick up last time's.
Istanbul works flawlessly with jasmine-node, using the command: `istanbul cover jasmine-node test'
Is it possible to use istanbul with mocha, in a similar way. I get the following:
I tried using https://github.com/arikon/mocha-istanbul as the reporter but got a similar error.
The text was updated successfully, but these errors were encountered: