Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Error creating istanbul html report due to invalid file name #336

Open
albertodeago opened this issue Apr 2, 2020 · 2 comments
Open

Error creating istanbul html report due to invalid file name #336

albertodeago opened this issue Apr 2, 2020 · 2 comments
Milestone

Comments

@albertodeago
Copy link

Version

5.0.0

Reproduction link

https://github.com/albertodeago/vue-webcomponent/tree/feature/coverage-issue

Steps to reproduce

  • clone the repo, checkout the branch feature/coverage-issue
  • npm i
  • dist should already be populated (npm build:es otherwise)
  • npm run cypress:open (and then run the test)

What is expected?

The coverage step should not fail and a coverage report should be collected

What is actually happening?

The coverage step (with istanbul) is failing


Looks like it's failing because the html is trying to create files with invalid names.
This is because it tries to create the files for the Vue component with the rollup-plugin-vue queryparams

e.g.
file named TodoList.vue?rollup-plugin-vue=script.js

Looks like in the dist the bundled contains code like this

....
function cov_18z3v2j7yj() {
  var path = "C:\\wamp64\\www\\tests\\vue-webcomponent\\src\\components\\todoList\\TodoList.vue?rollup-plugin-vue=script.js";
  var hash = "e531caef3b1a08cf4b4cbc787bd69c985ff3e66d";
  var global = new Function("return this")();
  var gcv = "__coverage__";
  var coverageData = {
    path: "C:\\wamp64\\www\\tests\\vue-webcomponent\\src\\components\\todoList\\TodoList.vue?rollup-plugin-vue=script.js",
....

I think istanbul then is trying to create files with the name contained in "path" and thus it fails.
I opened an issue to babel-plugin-istanbul here because i though it was the babel plugin to do this but they say it's not there.

@hy-inger
Copy link

Got the same problem. The path '*?rollup-plugin-vue=script.js' is invalid. Is there any solution?

@wxsms
Copy link
Member

wxsms commented Jul 29, 2020

My coverage runs, but results:

image

the report for MultiSelect.vue is broken and incorrect:

image

the report data for MultiSelect.vue?rollup-plugin-vue=script.js seems correct but not viewable:

image

What I expect:

  1. *.vue file should have correct coverage.
  2. *?rollup-plugin-vue=script.js file should not appear.

@znck znck added this to the Zero Issues milestone Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants