The coverage isn't working on testee plugin


#1

I’ve been working with the testee plugin with grunt to test the code developed with canJs. The test are done in QUnit and the imports are made with Steal.

The Grunt task:

testee: {
options: {
root: ‘./’,
browsers: [‘firefox’],
reporter: ‘Spec’
},
coverage: {
options: {
browsers: [‘firefox’],
coverage: {
dir: ‘report/coverage/’,
reporters: [‘text’, ‘html’],
ignore: [
‘node_modules/’
]
}
},
src: [
‘index.html’
]
},
src: [
‘index.html’
]
}

When running “grunt testee” the tests sometimes run and don’t give any output according to coverage, or sometimes they don’t run at all and the console stays awaiting and also when running the coverage task, it freezes the loading of the imported test js file inside index.html. There are times that the testee run the tests one time all going right, and in the next run show this message:
“Warning: Cannot read property ‘test’ of undefined Use --force to continue.” and fails


#2

Can you by chance put up the breaking project on GitHub? I also did notice some other cases where coverage wasn’t working but it would be good to have other examples to reproduce it.


#3

It’s impossible to include the breaking code on github, if there’s any other type of collaboration to be easily to identify the problem just say.
Btw I’m using ES6 imports and I think that the problem may be related to the kind of import (dependencies).


#4

Indeed. In fact, I am seeing the same problem. I don’t think Istanbul can instrument code coverage for ES6 code. They did make a new beta release recently which seems to support it. I will try upgrading and let you know shortly.


#5

I’ve figured that and have changed the kind of imports and it’s working right now. I couldn’t wait more to have the build working.
Is there anything that I can do to help?


#6

Hy,
Did you have news regarding the Instambul code coverage in ES6?
I’ve a need to have ES6 imports and code coverage working.

Br,


#7

This issue hasn’t been resolved, I believe it’s a difficult issue to solve.