Nuxt.js: Code coverage using nyc and ava guide

Created on 5 Jun 2017  路  13Comments  路  Source: nuxt/nuxt.js

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)
question

Most helpful comment

Hi @piyushchauhan2011

It's planned but only after 1.0 release

All 13 comments

Maybe we should have guides for karma testing as the default vue-loader has documentation for karma coverage and testing https://vue-loader.vuejs.org/en/workflow/testing.html

Tried using this as a reference as the coverage works on this project https://github.com/eddyerburgh/avoriaz-ava-example/issues/8. Using this config makes server running infinitely not sure why though

Couldn't make it work not sure why coverage is just blank 馃槥

@pi0 @eddyerburgh I was thinking if there are any thoughts about coverage integration with Nuxt ?

Hi @piyushchauhan2011

It's planned but only after 1.0 release

@Atinux cool, no worries ;)

+1

+1

+1

+1

What about this ? Any good news ? I got same result in version [email protected]

Closing as there's been no updates over 90 days.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazycrazy picture lazycrazy  路  3Comments

uptownhr picture uptownhr  路  3Comments

bimohxh picture bimohxh  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

jaredreich picture jaredreich  路  3Comments