-
Notifications
You must be signed in to change notification settings - Fork 36
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
What does reloadTasks do with regard to __coverage__? #16
Comments
Hi whererhys, taichi (the autor) stated in this #8 (comment), that But I am also unable to get this plugin to work as intended. I don't know at which point the coverage-objects (json files) should be generated, and what is reponsesible to store the coverage-objects to Currently I help me with a ugly shell task ala Any further hint would be gladly appreciated. |
@weemonger You can see at https://github.com/wheresrhys/jigsnreels what I have set up. Not sure how adaptable it'll be to your needs, but take a look anyway |
I am trying to use grunt-testem and grunt-istanbul together as you can see bellow, in my Gruntfile.js. my Gruntfile.js: module.exports = function(grunt) {
}; This is my second day dealing with this full time >.<' |
Hi Santiago, I feel your pain, I took me a while to grok istanbul (and this grunt-plugin). Regarding your problem, there are two case for this error:
Istanbul instruments the src files in such a way, that they write the coverage information in a global variable (default: coverage), during their execution. Therefore the test run have to use the instrumented files instead of the normal source files (file path for I think for your gruntfile, that both cases apply (I don't know testem, so bear with me, if I am wrong). You let the run against the normal src files: testem: {
env: {
src: [
'src/**/*.js', use another grunt task target to specify the instrumented files: testem: {
env: { ... },
coverage: {
src: [
'build/instrument/src/**/*.js',
'test/**/*.js'
],
...
}
} Also it seems to me, that you try to run the tests in a browser (chrome). This will not work with the So you have to store the coverage information in an other way (cf. gotwarlost/istanbul#16 (comment)). Some use a afterAll/tearDown method or a separate test case, which will be run at last by their testing framework, to write the content of the global I hope this helps. |
weemonger, you were right, thank you very much. On the one hand, I had to config the instrumentation as you wrote because was wrong and then, I got it. On the other hand, I have found a faster way to do what I want using grunt-template-jasmine-istanbul. I would like to use testem + istanbul, but it is a little harder so... I give up. Maybe I need to know how nodeJS works. Anyway, my closest attempt is something like this: |
Is anyone successful in using this package without 'reloadTasks'? I get the error I'm trying to get the coverage report for server side ES5 files in a node JS project that uses Grunt for build. Even if I add grunt task for 'reloadTasks' there are lot of errors on the dependencies. Any help is appreciated! |
@reefath, As I stated above (quoting myself: #16 (comment)), either:
For further help please provide your gruntfile (as a new issue with more details). @wheresrhys & @taichi: I think this issue can & should be closed. |
I'm trying to implement an istanbul report on code that's bundled using browserify, using the approach recommended here gotwarlost/istanbul#59 (comment). I've completed every recommended step (I instrument my src, bundle it, then bundle my test files and get them to reference the instrumented src bundle), but using grunt-istanbul ,my reports are always empty.
If I run
reloadTasks
on my instrumented src files (as you do in your gruntfile) then I do get a report, but it evidently doesn't use my bundled, instrumented src as the results show no code was run even though all the tests run and pass. If I don't run reloadTasks I getFatal error: No coverage information was collected
when runningstoreCoverage
.All the code is here https://github.com/wheresrhys/on-guard/tree/browserify (note that it's the 'browserify' branch)
The text was updated successfully, but these errors were encountered: