pull_request_coverage 0.0.5 copy "pull_request_coverage: ^0.0.5" to clipboard
pull_request_coverage: ^0.0.5 copied to clipboard

A CLI tool to verify the test coverage of a pull request only, ignoring the rest of the project.

example/readme.md

CLI output #

flutter test --coverage
git diff origin/main | dart bin/pull_request_coverage.dart  --maximum-uncovered-lines 5 --minimum-coverage 99 --output-mode cli    

CLI is the default output-mode. It is not necessary to specify it.

You can disable the colors using --use-colorful-output false

Screenshot 2022-12-10 at 10 43 18

Markdown output #

flutter test --coverage
git diff origin/main | dart bin/pull_request_coverage.dart  --maximum-uncovered-lines 5 --minimum-coverage 99 --output-mode markdown    

Output example

  • lib/src/presentation/use_case/print_analyze_result.dart has 1 uncovered lines (+3)
  10:  
  11:    void call(AnalysisResult analysisResult, UserOptions userOptions) {
  12:      if (analysisResult.totalOfNewLines == 0) {
- 13:       print("This pull request has no new lines");
  14:        return;
  15:      }
  16:  

After ignoring excluded files, this pull request has:

  • 236 new lines, 94 of them are NOT covered by tests. You can only have up to 5 uncovered lines
  • 60.16949152542372% of coverage. You need at least 99.0% of coverage

Markdown output using dart mode #

flutter test --coverage
git diff origin/main | dart bin/pull_request_coverage.dart  --maximum-uncovered-lines 5 --minimum-coverage 99 --output-mode markdown --markdown-mode dart 

Output example

  • lib/src/presentation/use_case/print_analyze_result.dart has 1 uncovered lines (+3)

void call(AnalysisResult analysisResult, UserOptions userOptions) {
  if (analysisResult.totalOfNewLines == 0) {
    print("This pull request has no new lines");	// <- MISSING TEST AT LINE 13
    return;
  }

After ignoring excluded files, this pull request has:

  • 236 new lines, 94 of them are NOT covered by tests. You can only have up to 5 uncovered lines
  • 60.16949152542372% of coverage. You need at least 99.0% of coverage

16
likes
0
pub points
58%
popularity

Publisher

unverified uploader

A CLI tool to verify the test coverage of a pull request only, ignoring the rest of the project.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args

More

Packages that depend on pull_request_coverage