You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executing the index.mjs script with node alongside the NODE_V8_COVERAGE environment variable, the output coverage map incorrectly shows the line 9 of lib.mjs (};) as uncovered.
NODE_V8_COVERAGE=./coverage node index.mjs
The coverage map file, with only the two relevant scripts for readability:
@juanarbol , I agree and I would, but the only thing I know is that it fails when using Node.js: I have no idea how Node.js itself propagates this environment variable to V8. I'm afraid that if I open an issue there, explaining exactlty what I explain in the current issue, they will answer "this is a Node.js issue, open an issue to their repository".
I need to know what Node.js is doing with this environment variable so that I can open an issue at V8. And for that, I'm afraid I need your help.
Node.js simply uses the V8’s inspector protocol for this. And Node.js or C8 gets all the output collected from the V8, is it not manipulated, nor the scripts are instrumented by Node.js, everything is V8, Node.js simply bypasses the output.
Version
v20.13.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Consider the following scripts:
Executing the
index.mjs
script with node alongside theNODE_V8_COVERAGE
environment variable, the output coverage map incorrectly shows the line 9 oflib.mjs
(};
) as uncovered.NODE_V8_COVERAGE=./coverage node index.mjs
The coverage map file, with only the two relevant scripts for readability:
How often does it reproduce? Is there a required condition?
It happens only when using either:
The following variant of
lib.mjs
is not impacted:The following variant of
lib.mjs
is not impacted:What is the expected behavior? Why is that the expected behavior?
The entirety of
lib.mjs
should be shown as covered.What do you see instead?
The range 174:175 is considered as uncovered:
Additional information
This issues has been impacting c8, among other code coverage tools:
bcoe/c8#497
The text was updated successfully, but these errors were encountered: