JS-DevTools / coverage-istanbul-loader

Istanbul code coverage loader for Webpack
https://jstools.dev/coverage-istanbul-loader/
MIT License
32 stars 9 forks source link

There are some uncovered lines for Vue 3 templates with Typescript #11

Open gtrombitas opened 2 years ago

gtrombitas commented 2 years ago

There is a testing extension for Quasar Framework that introduces code-coverage support for Cypress e2e testing: link I created a Pull Request for introducing Webpack code coverage support for this library: link @maiolica highlighted that there some issues with the covered lines for .vue template files but there aren't with .ts files. I've looked into it and I've had the same results in my template files.

Screenshot 2022-07-19 at 12 07 43

I used the following webpack loader rule to instrument the code:

{
          test: /\.(js|ts|vue)$/,
          loader: '@jsdevtools/coverage-istanbul-loader',
          options: { esModules: true },
          enforce: 'post',
          exclude: [/\.(e2e|spec)\.(js|ts)$/, /node_modules/, /\.quasar/],
}

What could be the problem? Do I need to add an another loader to handle .vue files better?

You can test it when you follow the instructions from the PR.

  1. Pull quasar-testing repo.
  2. Checkout dev branch.
  3. yarn install in the root directory.
  4. Follow the instructions from Other information part of the PR to test cypress e2e coverage.
gtrombitas commented 2 years ago

@JamesMessinger, @rkrauskopf, @Pouja Is there any chance to this issue will be handled in the future? Thank you for the response.