github TypedDevs/bashunit 0.31.0

8 hours ago

Adds timed setup/teardown hooks, introduces Bash code coverage with reports and thresholds, and fixes bench tests.

✨ Improvements

  • Display set_up_before_script and tear_down_after_script execution with duration
    • Shows "Running hook_name... done (Xs)" during test runs
    • Helps identify slow setup/teardown operations
    • Suppressed in failures-only and parallel modes
  • Add code coverage tracking with --coverage flag
    • Tracks line coverage using Bash DEBUG trap mechanism
    • Configurable source paths via --coverage-paths (default: src/)
    • Configurable exclusions via --coverage-exclude (default: tests/*,vendor/*,*_test.sh,*Test.sh)
    • LCOV format output via --coverage-report (default: coverage/lcov.info)
    • HTML coverage report via --coverage-report-html <dir> with line-by-line highlighting
    • Minimum coverage threshold via --coverage-min (fails if below)
    • Console-only mode with --no-coverage-report
    • Color-coded console output with configurable thresholds (50%/80%)

🐛 Bug Fixes

  • Fix bench command not working in standalone/installed bashunit (missing benchmark.sh in build)
  • Fix helper::get_latest_tag returning version with ^{} suffix from annotated git tags

👥 Contributors

Checksum

SHA256: a674f92ff2e44b905a0bcb00944ac35e89cdce0d2a6074c2eb829976116b0c9d

Full Changelog: 0.30.0...0.31.0

Don't miss a new bashunit release

NewReleases is sending notifications on new releases.