Open kof opened 8 years ago
I can sort this out 👍
There is a prob with node 7 #338 @nathanmarks can you help out with both issues?
Maybe it's worth to replace codecov with nyc (istanbul) ?
Maybe, especially because we have multi repo approach and run tests from other repos here.
nyc
has some issues with es6 modules. I recommend this project instead https://github.com/gotwarlost/istanbul.
But the two projects previously mentioned doesn't work with karma+webpack. We would need istanbul-instrumenter-loader. They are almost done solving the source-map
issue in order to remap to the original source files. As far as I know, we cannot have codecov with karma+webpack+babel before this is solved. I am following this closely as I'm doing this for my own projects too. Once this blocking issue is resolved, I will apply it to my own projects, and I can definitely help out here as well.
Recently @kentcdodds tweeted he workarounded this with ln -s node_modules/n_modules
https://twitter.com/kentcdodds/status/803980884026146816 ... opinions?
Sounds like the problem here isn't related to covering node_modules but in getting coverage working with karma and ES6. Have you tried babel-plugin-coverage?
I cover this in my Frontend Masters Webpack workshop (here's the diff) and in my Egghead course (here's the diff).
Hope that's helpful!
Maybe it would be much simpler to just add coverage for jss itself here and for all other repositories separately in the corresponding repository the same way. Should be easy, right?
Basically jss needs plugins to transform stylesheets. So you only need to test actual and expected code. e.g.
const transformer = transformWith(require('jss-extend'))
assert.deepEqual(transformer({
foo: {
color: 'red',
},
bar: {
extend: 'foo',
},
}), {
foo: {
color: 'red',
},
bar: {
color: 'red',
},
})
And you don't need browser for it.
JSS needs karma
only to test style injection AFAIK all other use cases can be solved inside node.
Well if I use karma in one case, why to use something else additionally, seems like an overhead. And no, plugins do in some cases way more than transforming style object.
I started by adding code coverage to react-jss
https://github.com/cssinjs/react-jss/pull/66.
babel-plugin-istanbul seems to work well. @kentcdodds thanks for the tip.
Current setup of codecov.io isn't working ...