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

feat(coverage): add summary reporter #21535

Merged
merged 5 commits into from
Dec 12, 2023
Merged

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Dec 11, 2023

This PR adds 'summary' reporter to deno coverage command. The reporter shows the coverage report in the terminal like the below:

Screenshot 2023-12-11 at 21 55 28

This change also makes this output format default of deno coverage. The existing default output (PrettyCoverageReporter) is now available via --pretty flag. (@bartlomieju and I discussed about this default behavior change offline).

part of #21325

"----------------------------------
File | Branch % | Line % |
----------------------------------
All files | 40.00 | 60.98 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this output match one from any of the existing tools?

I'm thinking that maybe we could do something like this:

----------------------------------
File         | Branch % | Line % |
----------------------------------
 bar.ts      |     0.00 |  57.14 |
 baz/quux.ts |     0.00 |  28.57 |
 baz/qux.ts  |   100.00 | 100.00 |
 foo.ts      |    50.00 |  76.92 |
----------------------------------
 All files   |    40.00 |  60.98 |
----------------------------------

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Looks better to me

Screenshot 2023-12-12 at 0 15 45

Copy link
Member

@ry ry Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably one decimal place of precision would be enough. EG

----------------------------------
File         | Branch % | Line % |
----------------------------------
 bar.ts      |     0.0 |  57.1 |
 baz/quux.ts |     0.0 |  28.5 |
 baz/qux.ts  |   100.0 | 100.0 |
 foo.ts      |    50.0 |  76.2 |
----------------------------------
 All files   |    40.0 |  60.9 |
----------------------------------

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Screenshot 2023-12-12 at 1 05 34

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kt3k kt3k merged commit 5ddf873 into denoland:main Dec 12, 2023
14 checks passed
@kt3k kt3k deleted the coverage-summary-reporter branch December 12, 2023 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants