Home

Issue: 840

Code coverage using nyc and ava guide

[issue link]

Hey @alexchopin , I’m trying to configure nyc and ava to get the code coverage report but currently it just outputs a 100% coverage for the files .eslintrc,.nuxt.config.js and modules directory. I searched but couldn’t find a way to get the coverage for .vue files using nyc ava. Vue.js documentation currently uses karma etc.

NYC config:

"nyc": {
    "exclude": [
      "modules",
      "plugins",
      "static",
      "assets",
      "**/*.test.js",
      ".eslintrc.js",
      "nuxt.config.js"
    ],
    "extension": [
      ".js",
      ".vue"
    ]
  }

Test commands:

"test": "./node_modules/.bin/nyc ava",
"report": "./node_modules/.bin/nyc report --reporter=html",
"codecov": "./node_modules/.bin/nyc report --reporter=lcov > coverage.lcov && codecov"
This question is available on Nuxt.js community (#c719)