-
-
Notifications
You must be signed in to change notification settings - Fork 359
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 #666
Comments
@bcoe turns out I was wrong, #649 is not the cause of this issue. It's #637. I guess that map.filter(function (filename) {
return _this.exclude.shouldInstrument(filename)
}) should happen before map.data = this.sourceMaps.remapCoverage(map.data) But I'm not really sure as I don't fully understand #637. |
@vanduynslagerp hmm, this is pertinent to my interests because I specifically wanted this feature landed for Node.js any thoughts on how we can have our cake and eat it too? (CC: @schutm). Shouldn't the fact that we've already remapped our coverage ( |
What I'm doing is something similar to what is described in #637:
In order to make that works (in With I tried to add the content of I didn't dug really deep so far, but I think the problem is that when So in the scenario of
So my understanding (and I might miss something here) is that the scenario described in #637 was already working as long as you add the actual files you are testing on to the |
@vanduynslagerp out of curiosity, do things work for you if you do move the |
Do you mean here ? That was my intuition as well. So, to be clear, that works: map.filter(function (filename) {
return _this.exclude.shouldInstrument(filename)
})
map.data = this.sourceMaps.remapCoverage(map.data) That does not work: map.data = this.sourceMaps.remapCoverage(map.data)
map.filter(function (filename) {
return _this.exclude.shouldInstrument(filename)
}) |
@vanduynslagerp 👍 cool, if you submit a pull request with that change I'll try to get a patch out the door ASAP -- @schutm would you be able to confirm whether this modified implementation would continue to work for your use-case? |
Sure ! PR done #667 |
@vanduynslagerp I think my use case is slightly different. You have your sources and transpiled files in the same root folder (project folder). I have my transpiled files in folder next to my project folder. E.g. your structure looks like:
Mine would like:
|
Expected Behavior
As previous version, the expected behavior is to include in the coverage all the files in
include
property whether they have a sourcemap or not.It seems to be a regression due to #649.
Observed Behavior
When a file referenced in
include
has a sourcemap it's excluded from the coverage report.Bonus Points! Code (or Repository) that Reproduces Issue
src/index.js
with some sample code in itbabel src --source-maps --out-dir lib
to create a compiled with a sourcemap inlib
lib/index.js
and test itnyc ava -v
NYC config in
package.json
:NYC will report:
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | Unknown | Unknown | Unknown | Unknown | |
----------|----------|----------|----------|----------|----------------|
Forensic Information
Operating System: OS X
Environment Information: https://gist.github.com/vanduynslagerp/8ff68570c269ed0f11403c77b128ad88
The text was updated successfully, but these errors were encountered: