8

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
user2360062
  • 663
  • 2
  • 7
  • 19
  • 1
    can 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 Answers1

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",
  ...

sample

rodurico
  • 751
  • 7
  • 17