Does NYC/Istanbul code reporting tool ignore template and style tags within a VueJS component file (with the extension .vue). Is nyc smart enough to do that?
Asked
Active
Viewed 1,427 times
8
-
1can anyone even get the coverage to instrument vue files? tried with both webpack and babel instrumenters, no dice – light24bulbs May 24 '18 at 18:01
1 Answers
0
Yes, it is possible @light24bulbs! I've made nyc + Vue + Mocha work here.
I've failed some times before making it work, thought. The thing that made the trick was to manually select the defaults while (re)creating the project with vue-cli. Vue-cli has proven to be much better than me configuring webpack.
$ node --version
v10.16.0
$ vue --version
3.11.0
//package.json
...
"scripts": {
...
"test": "nyc vue-cli-service test:unit"
},
"nyc": {
"extension": [
".js",
".vue"
]
},
"devDependencies": {
"nyc": "^14.1.1",
...

rodurico
- 751
- 7
- 17