Generate and analyze test coverage for your project.
Generates and analyzes test coverage reports with multi-language support and threshold enforcement.
/plugin marketplace add Data-Wise/craft/plugin install data-wise-craft@Data-Wise/craftcode/Generate and analyze test coverage for your project.
/craft:code:coverage [options]
| Project | Tool | Config |
|---|---|---|
| Python | pytest-cov, coverage.py | pyproject.toml, .coveragerc |
| JavaScript | c8, nyc, jest --coverage | package.json |
| R | covr | - |
| Go | go test -cover | - |
| Rust | cargo tarpaulin | - |
--html - Generate HTML report--json - Generate JSON report--fail-under <N> - Fail if coverage below N%--branch - Include branch coverage# Basic coverage report
/craft:code:coverage
# Generate HTML report
/craft:code:coverage --html
# CI mode with threshold
/craft:code:coverage --fail-under 80
# Include branch coverage
/craft:code:coverage --branch
Running tests with coverage...
Name Stmts Miss Cover
-------------------------------------------
src/main.py 120 12 90%
src/utils.py 45 5 89%
src/api/handlers.py 80 20 75%
tests/conftest.py 30 0 100%
-------------------------------------------
TOTAL 275 37 87%
Uncovered lines:
src/api/handlers.py: 45-48, 72-80
Works with:
/craft:test:run - Run tests/craft:code:ci-local - Pre-commit checks/craft:code:release - Release validation