Analyze test coverage and identify untested code.
Analyzes test coverage and identifies untested code with suggestions.
/plugin marketplace add Data-Wise/craft/plugin install data-wise-craft@Data-Wise/crafttest/Analyze test coverage and identify untested code.
/craft:test:coverage [options]
| Metric | Description |
|---|---|
| Line | Percentage of lines executed |
| Branch | Percentage of branches taken |
| Function | Percentage of functions called |
| Statement | Percentage of statements executed |
--report <type> - Report type: terminal, html, json--threshold <N> - Minimum coverage percentage--show-missing - Show uncovered line numbers--by-file - Breakdown by file--suggest - Suggest tests for gaps# Basic coverage report
/craft:test:coverage
# HTML report
/craft:test:coverage --report html
# Show missing lines
/craft:test:coverage --show-missing
# Enforce threshold
/craft:test:coverage --threshold 80
# Get test suggestions
/craft:test:coverage --suggest
Running tests with coverage...
Coverage Report
─────────────────────────────────────────
File Lines Branch
─────────────────────────────────────────
src/auth.py 95% 88%
src/api/handlers.py 72% 65%
src/utils.py 100% 100%
src/db/models.py 85% 80%
─────────────────────────────────────────
TOTAL 87% 82%
Uncovered lines:
src/api/handlers.py: 45-48, 72-80, 95
Suggested tests:
- test_handler_error_cases (lines 45-48)
- test_handler_edge_cases (lines 72-80)
Works with:
/craft:test:run - Run tests/craft:code:coverage - Code coverage command/craft:code:ci-local - CI checks