istanbuljs/istanbuljs

[report/html-spa] Incorrect placement of root index.html when there's only one top level folder

rudwna opened this issue · 0 comments

rudwna commented

When running coverage report with html-spa reporter (through jest) and there's more than one top-level directory for example:

/src
/test

The output index.html location will be correct (inside the default /coverage function for jest) that is: /coverage/index.html.

But if I excluded the /test folder from collecting coverage, the output index.html will be inside the /src folder, that is: /coverage/src/index.html. Which if open, will not be able to find the top-level resource(CSS, JS) but if I manually move the file to /coverage/index.html it'll works.

Also I observe that after I move the file and open it, the directory seems to be flattened. For example, instead of seeing an entry for /src/app.ts, I only see app.ts

version:

jest: 27.5.1
istanbul-reports 3.1.5