Support ES6 classes syntax with working coverage
Closed this issue · 4 comments
Probably this outstanding branch check could be fixed by adding some additional test for component itself. Will play a bit more with it.
Hmm, Firefox Dev edition supports Classes syntax if used with
<script type="application/javascript;version=1.7"> (or version=1.8) tag.
http://kangax.github.io/compat-table/es6/#class
So the possible solution could be to use Firefox Dev edition and disable bunch of BabelJS transpiling options, so the code for instrumenter will be coming mostly untouched.
I tried to avoid extra transformations using babel's blacklist
option and Firefox Dev Edition. Import/export
is not yet supported anywhere, so I blacklisted only classes
. Classes are supported only with <script type="application/javascript;version=1.7">
so I modified karma's internal html.
Another problem was that webpack does not support es6 and gives compilation errors, when it sees class
. That could be fixed by using npm install webpack/webpack#webpack-2
branch which uses acorn
parser and does not fail horribly anymore.
After all things I still could not get the coverage report, though doing normal webpack compilation worked and Firefox Dev was showing working site as expected.
That does not look like a working solution anyway :(
Oh, yes! It is solved with https://github.com/deepsweet/isparta-loader
Beautiful
All fixed with 2e90d07