-
Notifications
You must be signed in to change notification settings - Fork 249
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
Support CoffeeScript code coverage #19
Support CoffeeScript code coverage #19
Conversation
😉 Oh and fixed up the tests. |
Can you please squash your commits together? other than that you've got my 👍 |
Squashed :squirrel: |
Looking forward to getting this pull request in 👍 |
+1 |
3 similar comments
+1 |
👍 |
+1 |
This would be great! |
+1 |
"dependencies": { | ||
"istanbul": "~0.1.41", | ||
"ibrik": "git://github.com/HBOCodeLabs/ibrik.git#304cd84936d33cf38a05a1a4fe58c82d54ff6cfa", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to use https
please, as some people have problems due to their networks being restricted to use git
protocol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 🐱
+1 |
👍 This is great thanks for the work! |
thanks guys, much appreciated. Hope all is fine and it gets merged in soon. |
+1 |
@kylewelsby I tried out your patch and am having a weird error where preprocessor.coverage seems to be trying to parse files that have already been converted to js as coffeescript. Here is my karma.conf.js. The errors I'm getting are: Running "karma:unit" (karma) task INFO [karma]: Karma v0.10.5 server started at http://localhost:8080/ INFO [launcher]: Starting browser PhantomJS ERROR [preprocessor.coverage]: Error compiling ./app/scripts/app.coffee: reserved word "var" at /Users/carl/Source/sandbox/testmanager_yeoman6/app/scripts/app.coffee ERROR [preprocessor.coverage]: Error compiling ./app/scripts/app.coffee: reserved word "var" at /Users/carl/Source/sandbox/testmanager_yeoman6/app/scripts/app.coffee INFO [PhantomJS 1.9.2 (Mac OS X)]: Connected on socket Dy18KyMuhedVgr3Yr_N5 PhantomJS 1.9.2 (Mac OS X) ERROR Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.1/$injector/nomod?p0=app at /Users/carl/Source/sandbox/testmanager_yeoman6/app/bower_components/angular/angular.js:1507 PhantomJS 1.9.2 (Mac OS X): Executed 0 of 0 ERROR (0.077 secs / 0 secs) Warning: Task "karma:unit" failed. Use --force to continue. Aborted due to warnings. |
Hi @cayblood yes, @karma-coverage with CoffeeScript support does compile the files to JavaScript, so you'll not need to re-compile. This was not intentional. It's how Ibrik handles the files. You'll need to make sure coverage files are not passed though the coffee-script preprocessor.
As seen in the updated README not sure if the coffee-script preprocessor does or will ever check if the document has already been compiled. |
@kylewelsby Thanks but did you look at my karma.conf.js file linked above? That is precisely how I've configured it and I'm still getting errors. |
@kylewelsby This debug output may be of help. It looks like the preprocessor is handling each file twice. I'm still trying to debug it. |
Your file Globbing is checking for
|
@kylewelsby This patch fixes the duplication in the preprocessor but now it seems that karma is just stuck waiting for my tests to run. The test runs fine if I comment out the preprocessor config lines entirely, but then of course I don't get any coverage. |
@kylewelsby the globbing actually doesn't overlap. |
@kylewelsby Incidentally, if you want to reproduce this error in its entirety, it should be sufficient to run the following code in an empty directory: npm install -g yeoman npm install -g generator-angular yo angular --coffee Then add "karma-coverage": "git://github.com/kylewelsby/karma-coverage.git#73818fc" as a devDependency in your package.json file, run |
Hi @cayblood I have not been able to replicate your issue, here is the repository of my workings.
Default settings add to
add to
then run
results in DEBUG INFO |
@kylewelsby very sorry but after following the same steps I can't reproduce this bug either. It seems like it may have been related to some strange state in my project but even after diffing everything I can see no apparent differences that would be causing this. Anyhow, I'm very glad to have it working now and thanks for your help in getting to the bottom of this. |
No problem @cayblood glad I was able to help you. |
There we go @vojtajina, rebased 👍 |
"dependencies": { | ||
"istanbul": "~0.1.45", | ||
"ibrik": "~1.0.1", | ||
"ibrik": "git+https://github.com/HBOCodeLabs/ibrik.git#304cd84936d33cf38a05a1a4fe58c82d54ff6cfa", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version of Ibrik
uses Standard Coffee-Script Library and not the CoffeeScript Redux version the master Ibrik
depends upon. CoffeeScript Redux clashes completely with the rest of the Karma build.
Cool, can you also update the commit msg to follow http://karma-runner.github.io/0.10/dev/git-commit-msg.html - something like Thanks a bunch. |
@vojtajina I have edited the commit message. Hope all is well. 🎄 |
👍 |
2 similar comments
👍 |
👍 |
I'm trying to pull your branch fix-coffee-script-compiler in my package.json file as: "karma-coverage": "https://github.com/kylewelsby/karma-coverage/tree/fix-coffee-script-compiler" but I am getting the following error: GET https://github.com/kylewelsby/karma-coverage/tree/fix-coffee-script-compiler |
Figured out my issue. Add this line to package.json: "karma-coverage": "git+https://github.com/kylewelsby/karma-coverage#fix-coffee-script-compiler" Note, this replaces the line above: As the 73818fc tag no longer seems to exist in the repository. This pull request works great for coffee coverage. I hope to see it pulled into the master karma-coverage soon! |
👍 |
Been using this for a few weeks now and love it. 🚢 |
thanks @hijonathan 🍰 |
👍 I set it up yesterday. Works great on my yeoman-maintained AngularJS project. Thanks. |
+1 Any word on when this will land in master? |
👍 Its works! |
@kylewelsby sorry for delays. I merged your docs/readme update as a35d8d0. The rest of your change is just changing the dependency to git protocol url, which causes problems (on windows) so I'd rather avoid that. Is there any problem with using the released ibrik 1.1.1? If so, plese re-open/comment. Otherwise I'm closing this. Thank you very much. |
hey @vojtajina, sorry to say, as long as Constellation/Ibrik uses CoffeeScriptRedux, this will not work for karma as CoffeeScriptRedux id not fully compatible with standard CoffeeScript syntax. Constellation/Ibrik is currently using CoffeeScriptRedux 2.0.0-beta8 |
any news? :) seems it does not work with current https://github.com/Constellation/ibrik |
Yeah @swayf as long as Constellation/Ibrik uses |
@kylewelsby Do you mean it should work with HBOCodeLabs/ibrik? hm.. seems I'm doing something wrong |
Yeah @swayf it should work with HBOCodeLabs/ibrik fork of |
Any updates? |
There is! Looks like posting here got missed in the excitement, but [email protected] uses standard coffeescript! Constellation/ibrik#16 and the version got bumped in ffa596a, which is in [email protected] |
That is great. |
Building on top of the work the @can3p has committed. I found that the CoffeeScript-redux compiler was too strict. @jstamerj done an amazing job of switching CoffeeScript-redux to standard CoffeeScript in Ibrik.
I just glued the bits together and updated the README to help avid CoffeeScript users add Coverage support to their projects.
This should resolve #12 and karma-runner/karma#622
Enjoy