-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
A final blankline in a file prevents 100% code coverage #11327
Comments
Thanks for the report, in the middle of a major overhaul of the entire thing so these serve as excellent new test fixtures! Just tagging myself for filtering purposes @caspervonb. |
@caspervonb is there a PR that should close this issue to track? This small bug makes code coverage via Deno unusable; perhaps a patch just for this could be pulled out of whatever major refactoring work you're doing, if it's a multi-month epic task? |
Will be fixed and shipped soon, sorry for leaving this open for so long but there's pretty much zero interest in coverage from my sponsors. |
Can this issue please be reopened since the PR that fixed it got reverted? |
A final newline in a file incorrectly prevents 100% code coverage when using the
deno test
anddeno coverage
CLIs.This is especially a problem because many projects enforce a final newline in files, via EditorConfig (
insert_final_newline
config), linters, or other means.To reproduce, in
example.js
(note the newline at the end):Then, in
example_test.js
:Run:
And note that the final line 4 is reported as uncovered, resulting in 75% code coverage for the file
example.js
:If you delete that final newline in
example.js
, the report changes to 100% code coverage:deno --version
:The text was updated successfully, but these errors were encountered: