preboot / angularjs-webpack

A complete, yet simple, starter for AngularJS using webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isparta-loader is deprecated, replace with babel-plugin-istanbul?

McGiogen opened this issue · comments

As from isparta-loader's readme, it is deprecated in favor of babel-plugin-istanbul.
I've made this change in my own project but I'm not sure I've done it correctly.
I can make a pr but I need an help to be sure it is all correct.

hi @McGiogen,

please send a PR with your changes. if everything is working we'll merge that PR.

thanks for you time.

I've forked and done some work. The problem now is that I don't know how to count every js file, my configuration is counting only webpack.config.js and karma.conf.js.

Tomorrow I will try to fix it.

I think the work is done. Coverage has changed, but it was expected (as said somewhere...)

Before:

=============================== Coverage summary ===============================
Statements : 95.24% ( 20/21 ), 1 ignored
Branches : 100% ( 6/6 ), 2 ignored
Functions : 75% ( 3/4 )
Lines : 92.31% ( 12/13 )

Now:

=============================== Coverage summary ===============================
Statements : 85.71% ( 6/7 )
Branches : 100% ( 0/0 )
Functions : 50% ( 1/2 )
Lines : 85.71% ( 6/7 )

@McGiogen why did the coverage change?

nope, the PR is totally wrong. you have to drop crossenv and whatever you added and use only the webpack plugin.

Next monday I'll improve it and I'll check about coverage percentage

i think that #53 is a proper fix for this issue. i will check later, eventually merging #53 and closing #52 .

I've updated the code in my pull request, now there is no more the dependency cross-env and every config the plugin needs is wrote in webpack.config.js. I used a temporary variable to be more consistent with the file style but obviously you can write the same using differents approaches.

Update: now it also works on Windows. I've checked both coverages and I think that everything could be ok but this is one of the first times I watch coverage of a project. You can see both reports below (everything else is unchanged).

before_ispartaloader
after_istanbulinstrumenterloader

when i said to use a webpack plugin i meant to use a webpack plugin, not a babel one!
in this way it's not possible to have a consistent coverage when using differents loader such as typescript along with babel. see the other PR to understand, it uses an loader-agnostic instrumenter to calculate coverage!

Well, you already have your pull request with a webpack plugin but "everyone" on the internet seems to want to use babel-plugin-istanbul. I repeat that I'm not an expert of tests and webpack but I've read a lot and;

This is why I thought that babel-plugin-istanbul could be a good idea.

In any case I opened the issue also to receive help so if you said that a webpack plugin is better I will believe you and I will continue to read to understand why (I don't have much time to spend so I'm a bit slow doing that).

sorry for confusing you guys. I just undeprecated isparta-loader back because new istanbul stuff is not completely ready yet.

closed via #53.