1

Is it possible to execute code coverage on CofeeScript sources without using CoffeeScriptRedux compiler (this one is use in ibrik). I understand advantages of this new compiler but looks like it's still not completed and doesn't work for my project.

1 Answer 1

4
+50

That would be nice to know more about your application but for most cases the response is yes.

For a Node application and using Mocha for unit tests, I used this project: https://github.com/benbria/coffee-coverage that will compile your Coffee files to add coverage instructions.

And then you can use applications such as: https://github.com/cainus/node-coveralls that will digest the previous reports and make it human readable.

But I know that the main Javascript Coverage frameworks can be compatible with Coffeescript.

For example, Blanket seems to be: https://github.com/alex-seville/blanket/blob/master/docs/compatibility_and_features.md#coffeescript-in-the-browser

The advantage of Blanket is that you can use it for a Node application as well as in the Browser (With Jasmine, or whatever). Also Blanket, compared to the other project, doesn't force you to change your test "require" statements.

Sign up to request clarification or add additional context in comments.

6 Comments

As far as you are the only one who responded you win:) But I still didn't find a good way to run code coverage on my project (github.com/volkhin/RoadTrafficSimulator). Anyway, thanks for help. Maybe I will just compile CoffeeScript into JS and run code coverage on JS. Should be good enough for the beginning.
Hello. That's nice to you but I feel a bit like a fraud there :) I can only guess you would have preferred a coverage report containing your true Coffee sources? It's true that Blanket render the Javascript compiled file. (And sometimes the percentage is just not enough ^^)
However, Blanket deal with all that crap automatically. It was very easy to plugged into mocha. It wouldn't be a problem at all to put the configuration in Gulp.
Sorry for the flood but I provided you with a PR on your project: github.com/volkhin/RoadTrafficSimulator/pull/5 Just to show Blanket ability. I'm very curious about your expectation and what can be done better :) (I am NOT a maintainer of Blanket :p)
It really works thanks a lot! I don't remember exactly what was the problem in the past with blanket, maybe I have tried to use it in different configuration (few week ago I was using jasmine for tests), but I didn't manage to run ibrik due to problems with CoffeeScriptRedux compiler and I decided it's a common problem. Thanks again, that's exactly what I was looking for!
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.