Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

paths are broken #1

Open
kmudrick opened this issue Dec 10, 2015 · 4 comments
Open

paths are broken #1

kmudrick opened this issue Dec 10, 2015 · 4 comments

Comments

@kmudrick
Copy link

I can submit a PR to show the behavior, but it seems to be flattening paths, which also causes same-named source files to get munged together instrumentation-wise.

Example: I added a directory called "foo" with two files in it: index.js and bar.js. The source of each just does a console log.

When I updated the test task to also use --include-all-sources, the html report shows:
bar.js 0% 0/1
index.js 60% 3/5

index.js - the 5 total lines is 4 from your original index.js plus 1 from my foo/index.js

In addition, clicking on index.js in the generated html report display an error: Cannot read property 'text' of undefined - from node_modules/istanbul/node_modules/istanbul-api/node_modules/istanbul-reports/lib/html/annotator.js:63:45

@kmudrick
Copy link
Author

FWIW this is with node 4.2.2

@kmudrick
Copy link
Author

Also, https://github.com/gotwarlost/istanbul/compare/v1 says that --include-all-sources defaults to true, but that is not the case.

@kmudrick
Copy link
Author

Ah, I see that it defaults to using the 'package' report summarizer, which is why I am getting this behavior.

Since I could not find how or where to configure that, I tried hardcoding the exports in istanbul-api/node_modules/istanbul-lib-report/lib/summarizer.js to all use createNestedSummary - but I still see the same behavior.

@gotwarlost
Copy link
Contributor

Could you please submit a PR to show the behavior? I suspect it is a problem with source-maps processing and multiple files getting mapped to the same source file.

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

2 participants