Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NYC v11.2.0 exclude file with sourcemap from coverage #668

Closed
Speedy37 opened this issue Sep 6, 2017 · 7 comments
Closed

NYC v11.2.0 exclude file with sourcemap from coverage #668

Speedy37 opened this issue Sep 6, 2017 · 7 comments

Comments

@Speedy37
Copy link
Contributor

Speedy37 commented Sep 6, 2017

Expected Behavior

Sourcemap of files that are far away from covered .js files should be included by default, not excluded.
This is a regression introduced by #637

Observed Behavior

All my sourcemaps are excluded :(

Forensic Information

shouldInstrument is called with "/myabsolutepath/@msbuildsystem/js.typescript/src/worker.ts"
the relFile path is "../../../../../@msbuildsystem/js.typescript/src/worker.ts"

witch return false due to line 81 in test-exclude/index.js (// Don't instrument files that are outside of the current working directory.)

@Speedy37
Copy link
Contributor Author

Speedy37 commented Sep 6, 2017

Because #637 is likely to cause a lot of regression, can't it be activated by a flag ? (like --filter-sourcemap)

I really like to keep my output files away from my source files

@bcoe
Copy link
Member

bcoe commented Sep 16, 2017

@Speedy37 see #674, let's try to figure out a solution that fits everyone's needs.

@Speedy37
Copy link
Contributor Author

Speedy37 commented Oct 3, 2017

Since issue #637 it's not possible have coverage if output files are not in a subdirectory of source files without including the source directory manually which is I think an unexpected default behavior.

There is multiple way to solve this:

  • if sources files are outside cwd directory then you must include them manually (current behavior since 11.1.0)
  • multiple root directories (I quite like this one)
  • two separate (include/exclude) filter (instrument/source)

@Speedy37
Copy link
Contributor Author

Speedy37 commented Oct 3, 2017

Finally after checking the sourcecode it's currently not possible to include files outside cwd, so the current behavior is: you can't have source files and instrument files in different roots

@bcoe
Copy link
Member

bcoe commented Oct 4, 2017

@Speedy37 would it be possible to provide a minimal failing example of this, which we could turn into a unit test. In a perfect world I'd like to appropriately handle the exclude logic, regardless of whether source-maps are used. It seems like the logic in #637 needs to be extend on.

@JaKXz
Copy link
Member

JaKXz commented Jan 23, 2019

Is this still an issue?

@istanbuljs istanbuljs deleted a comment from stale bot Jan 23, 2019
@stale
Copy link

stale bot commented Mar 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 24, 2019
@stale stale bot closed this as completed Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants