Release 0.21
🔧 New features
Benchmark your tests
You can now measure the runtime of any test using the new bench
feature. If a test exceeds your expected threshold, use the max_ms
option to mark it as failed.
bash
# @bench max_ms=10
function test_should_be_fast() {
sleep 0.01
}
✗ Failed: test_should_be_fast (Expected < 10ms, got 11ms)
Placeholder support in snapshots
Ignore dynamic values in your snapshots using placeholders like . This makes tests stable even when parts of the output vary between runs.
bash
function test_snapshot_with_placeholder() {
echo "ID: 12345" | assert_match_snapshot --ignore "{{ignore}}"
}
ID: {{ignore}}
Count data providers accurately
find_total_tests
now includes cases provided by @data_provider
, giving a more accurate count of total executed tests.
🐛 Bugfix
Parallel mode stability
Fixes were applied to ensure parallel mode works consistently across platforms, including improved detection on Windows and consistent execution on arch64
.
bash
# Works across systems and architectures
BASHUNIT_PARALLEL_RUN=true ./bashunit
Validate exit codes
A new test ensures the bashunit_exit_code
logic is correctly handled under different execution paths.
🌾 Miscellaneous
- Improved performance of internal
clock
utility - Flexible argument handling in the installer
- Project overview added to the docs site
- CI jobs now split between macOS and Ubuntu
- Fixed minor typo in spy assertion message
See the full changelog on GitHub