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

fix(cli): panic with deno coverage #23353

Merged
merged 19 commits into from May 13, 2024

Conversation

0xIchigo
Copy link
Contributor

This PR directly addresses the issue raised in #23282 where Deno panics if deno coverage is called with --include regex that returns no matches.

I've opted not to change the return value of collect_summary for simplicity and return an empty HashMap instead

@dsherret dsherret changed the title fix(cli) Fix panic with deno coverage fix(cli): panic with deno coverage Apr 13, 2024
@bartlomieju
Copy link
Member

Thanks for the PR, could you please add a test case that exercises this change? You can add an itest! check in tests/integration/coverage_tests.rs

@bartlomieju bartlomieju added this to the 1.44 milestone May 5, 2024
@0xIchigo
Copy link
Contributor Author

My apologies @bartlomieju — I missed your initial reply to this PR. I've gone ahead and added a test at tests/integration/coverage_tests.rs

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.

Looks good, thanks for the PR. Could you please use assert_contains! macro?

tests/integration/coverage_tests.rs Outdated Show resolved Hide resolved
tests/integration/coverage_tests.rs Outdated Show resolved Hide resolved
tests/integration/coverage_tests.rs Outdated Show resolved Hide resolved
@0xIchigo 0xIchigo requested a review from bartlomieju May 13, 2024 19:00
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, thanks!

@bartlomieju bartlomieju merged commit 329a8ae into denoland:main May 13, 2024
17 checks passed
bartlomieju pushed a commit that referenced this pull request May 16, 2024
This PR directly addresses the issue raised in #23282 where Deno panics
if `deno coverage` is called with `--include` regex that returns no
matches.

I've opted not to change the return value of `collect_summary` for
simplicity and return an empty `HashMap` instead
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.

None yet

2 participants