Skip to content

Latest commit

 

History

History
88 lines (63 loc) · 2.52 KB

README.md

File metadata and controls

88 lines (63 loc) · 2.52 KB

dokimi

Go Release Go Report Card Maintainability Test Coverage

Dokimi provides some helper commands for testing in Go.

Table of Contents

Installation

go install github.com/farbodsalimi/dokimi@latest

Commands

check-coverage

Usage:
  dokimi check-coverage [flags]

Flags:
  -c, --coverprofile string   coverprofile (default "coverage.out")
  -d, --do-not-fail           do-not-fail
  -h, --help                  help for check-coverage
  -t, --threshold float       threshold (default 100)

Example:

dokimi check-coverage --threshold=90 --do-not-fail

report

Usage:
  dokimi report [flags]

Flags:
  -h, --help              help for report
  -i, --input string      Path to input file
  -o, --output string     Path to output file
  -r, --reporter string   Reporter name e.g. istanbul, lcov, ...
      --show              Shows written reports

Write Istanbul json reports and display them

  1. Go inside your project directory and run your tests:

    go test -v -coverprofile=coverage.out ./...
  2. Show your coverage in Istanbul UI:

    dokimi report --input=coverage.out --output=coverage.json --reporter=istanbul --show

Only write Istanbul json reports

  1. Go inside your project directory and run your tests:

    go test -v -coverprofile=coverage.out ./...
  2. Generate Istanbul json file:

    dokimi report --input=coverage.out --output=coverage.json --reporter=istanbul