Skip to content

Releases: TypedDevs/bashunit

0.39.1

09 Jun 18:48
0.39.1
ffa9c79

Choose a tag to compare

🐛 Bug Fixes

  • bashunit upgrade resolved the floating v0 Action tag as the latest version, breaking upgrades; it now only considers exact-version tags

👥 Contributors

Checksum

SHA256: 0cb0153ebcf7198371051332b8e8fce36c47b514eef9bb362148f404837c2e82

Full Changelog: 0.39.0...0.39.1

0.39.0

09 Jun 18:09
0.39.0
f91a50f

Choose a tag to compare

✨ Improvements

  • GitHub Action args input: when set, runs bashunit <args> after installing, so a workflow can install and run the suite in a single step
  • Floating major tag for the GitHub Action: the release process now force-moves v0 to each release, so workflows can pin TypedDevs/bashunit@v0 to track the latest release within a major (#700)
  • bashunit init now scaffolds a .github/workflows/tests.yml CI workflow using the official action (existing files are left untouched) (#702)
  • --report-junit <file> flag as an alias of --log-junit, for naming parity with --report-html (#705)

🛠️ Changes

  • The GitHub Action's version input now defaults to the version pinned at the action ref instead of latest, so pinning the action by SHA pins a visible bashunit version
  • install.sh now verifies the release checksum by default (set BASHUNIT_VERIFY_CHECKSUM=false to opt out); it soft-skips with a warning when a checksum asset is unavailable unless verification was explicitly requested (#703)
  • --log-gha annotations now include the failing test's line (::error file=…,line=…), so they pin to the exact line in a pull request's "Files changed" tab (#704)

👥 Contributors

Checksum

SHA256: 37c228533b5e565147b4daaadfb2a1fe5227aa268de7dc41dd967fa85cab288f

Full Changelog: 0.38.0...0.39.0

0.38.0

07 Jun 16:02
0.38.0
38fd814

Choose a tag to compare

✨ Improvements

  • Official TypedDevs/bashunit GitHub Action: composite install action, pinnable by commit SHA for immutable installs (version, directory, add-to-path, verify-checksum inputs; path, version outputs) (#695)
  • install.sh sha256 checksum verification via BASHUNIT_VERIFY_CHECKSUM=true, validating the download against the release checksum asset (#695)

🐛 Bug Fixes

  • install.sh fails loudly (non-zero exit, no stub binary) on a failed download and retries transient failures, instead of silently reporting success (#695)
  • install.sh creates nested target directories (mkdir -p) (#695)

👥 Contributors

Checksum

SHA256: b1364d4874e61bc8cee4d9dea15844badebdbcc855d4d5b5439c9f4ae8b2204c

Full Changelog: 0.37.0...0.38.0

0.37.0

03 Jun 12:41
0.37.0
a849585

Choose a tag to compare

✨ Improvements

  • --profile reports the slowest tests (BASHUNIT_PROFILE_COUNT, default 10) (#678)
  • Readable snapshot diff when git is unavailable (#679)
  • Failure output shows the test file:line (#680)
  • .bashunitrc project config file (#681)
  • Killed tests report the cause: timeout, SIGINT, SIGKILL/OOM, SIGTERM (#683)

🐛 Bug Fixes

  • --strict skips Bash 3.0's broken pipefail (pipefail only on Bash >= 3.1)
  • bashunit watch forwards --filter and other flags correctly (#682)
  • learn and coverage use mktemp -d for temp directories
  • parallel::cleanup refuses to rm -rf outside */bashunit/parallel/*

Internal

  • Global-slot return pattern for hot-path helpers; _BASHUNIT_SPY_* namespace (#674)
  • Windows acceptance CI: matrix shards now cover every test file (bashunit_test.sh, coverage_*, install, mock were silently skipped) and job labels show only the shard name

⚡ Performance

  • Faster runtime-error detection: single case glob (#668)
  • Cache coverage-enabled flag in hot path (#664)
  • Parallel runner uses wait -n on Bash 4.3+ instead of polling (#667)
  • Hot-path result helpers return via global slots, dropping a fork per call (#662)
  • Drop grep/random_str forks in generate_id and normalize_variable_name (#663)

👥 Contributors

Checksum

SHA256: 18f1e8354213001b80e37c722b8520ebe26ce10fce11cb20ee471ddc96a21b11

Full Changelog: 0.36.0...0.37.0

0.36.0

07 May 15:55
0.36.0
0cdf8f0

Choose a tag to compare

🐛 Bug Fixes

  • bashunit upgrade exits non-zero with a clear error when the download fails (no more false success message)

✨ Improvements

  • --show-output displays captured test output on assertion failures (#637)
  • npm registry distribution: npm install -g bashunit (#244)
  • bashunit::env::supports_color and bashunit::io::clear_screen helpers (#247)
  • LCOV reports now include FN, FNDA, FNF and FNH function records, consumed by genhtml, Codecov and Coveralls
  • LCOV reports now include BRDA, BRF and BRH branch records for if/elif/else chains and case patterns (see adrs/adr-007-branch-coverage-mvp.md)
  • BASHUNIT_COVERAGE_SHOW_FUNCTIONS=true adds a per-function coverage block to the text report
  • BASHUNIT_COVERAGE_SHOW_UNCOVERED=true adds an "Uncovered Lines" block to the text report, with consecutive line numbers compressed into ranges

🛠️ Changes

  • Docs moved into their own npm workspace under docs/ (use cd docs && npm ci or make docs/install)
  • Pre-commit hook skips the test suite when no shell files are staged
  • ANSI escapes route through _BASHUNIT_COLOR_* constants (#247)

⚡ Performance

  • Faster coverage report generation: single-pass file scan, native bash regex, cached file stats (#636)

Internal

  • bashunit::runner::run_test split into nine named helpers (no behavior change)
  • release.sh handles docs/package.json as a first-class release file
  • Structural test guards root package.json against regaining dependencies or scripts

👥 Contributors

@Chemaclass

Checksum

SHA256: 29bffc3d492296c859640f7425a66f7ae0549e667e5265e3e84859a828edbf64

Full Changelog: 0.35.0...0.36.0

0.35.0

26 Apr 20:37
0.35.0
2015010

Choose a tag to compare

✨ Improvements

  • bashunit::spy accepts an optional exit code or custom implementation function (#600)
  • Assert functions accept an optional trailing label to override the failure title (#77)
  • --fail-on-risky flag and BASHUNIT_FAIL_ON_RISKY env var treat no-assertion tests as failures (#115)
  • --log-gha <file> flag and BASHUNIT_LOG_GHA env var emit GitHub Actions workflow commands so failed, risky and incomplete tests show up as inline PR annotations (#280)
  • assert_exec accepts --stdin, --stdout-contains, --stdout-not-contains, --stderr-contains and --stderr-not-contains flags to test interactive prompt commands and substring output (#301)

🛠️ Changes

  • Parallel test execution is now enabled on Alpine Linux (#370)

🐛 Bug Fixes

  • Dim/faint labels now render as gray (SGR 90) so keywords like Expected and Tests: stay colored in GitHub Actions logs (#323)
  • Syntax error in a test file now fails the suite instead of passing silently (#220)
  • --stop-on-failure now stops on runtime errors such as command not found or illegal option (#383)
  • Spying on echo or printf no longer hangs via infinite recursion (#607)
  • LCOV and HTML coverage reports no longer produce empty output under set -e (#618)
  • clock::now handles EPOCHREALTIME values that use a comma decimal separator
  • Invalid .env.example coverage threshold entry; CI now copies .env.example to .env so config parse errors are caught
  • Coverage no longer counts case patterns with trailing comments (e.g. *thing) # note) or loop terminators with redirections/pipes (e.g. done < file, done <<<"$var", done | sort) as executable lines (#634)
  • assert_true and assert_false now report empty strings as assertion failures instead of trying to execute them

👥 Contributors

Checksum

SHA256: bfe9f69bda77034234a38f26182cc34e1f7648d846dab57a513a14cf91977544

Full Changelog: 0.34.1...0.35.0

0.34.1

20 Mar 10:38
0.34.1
d6eabbb

Choose a tag to compare

✨ Improvements

  • Add risky test detection for tests with zero assertions (shown as warning, does not fail)

🐛 Bug Fixes

  • Fix source of non-existent file in set_up() silently passing all tests (#611)
  • Fix set_up running before strict mode — unbound variables in hooks now detected with --strict
  • Fix source failure in tear_down(), set_up_before_script(), and tear_down_after_script() silently passing
  • Add missing runtime error patterns: ambiguous redirect, integer expression expected, too many arguments, value too great, not a valid identifier, unexpected EOF

👥 Contributors

Checksum

SHA256: b620423b0fb201ff1c8d2c04735061cdea4237be84007348218a7e8d8522d8d0

Full Changelog: 0.34.0...0.34.1

0.34.0

17 Mar 13:23
0.34.0
7bc5561

Choose a tag to compare

✨ Improvements

  • Add --watch mode and watch [path] subcommand to re-run tests on file changes
    • Uses inotifywait on Linux or fswatch on macOS; clear install hint if unavailable
  • Add --jobs N flag to limit parallel test concurrency
  • Add --tag and --exclude-tag CLI flags for filtering tests by # @tag annotations
  • Add TAP version 13 output format via --output tap for CI/CD integration
  • Add source context display in failure summaries showing relevant assertion lines
  • Add date comparison assertions: assert_date_equals, assert_date_before, assert_date_after, assert_date_within_range, assert_date_within_delta
    • Auto-detects epoch seconds, ISO 8601, space-separated datetime, and timezone offsets
  • Add assert_have_been_called_nth_with for verifying spy arguments on the Nth invocation
  • Add assert_string_matches_format and assert_string_not_matches_format with format placeholders (%d, %s, %f, %i, %x, %e, %%)
  • Add JSON assertions: assert_json_key_exists, assert_json_contains, assert_json_equals (requires jq)
  • Add duration assertions: assert_duration, assert_duration_less_than, assert_duration_greater_than

🛠️ Changes

  • Split Windows CI test jobs into parallel chunks to avoid timeouts
  • Optimize clock: prioritize EPOCHREALTIME over subprocess-based fallbacks
  • Cache function discovery to avoid duplicate pipeline per test file
  • Reduce subshells in test execution hot path
  • Batch coverage recording with in-memory buffering
  • Cache uname result at source time to eliminate repeated subprocess forks
  • Replace bc and awk subprocesses with native bash arithmetic in clock and duration formatting
  • Cache base64 -w flag support at load time instead of detecting per test
  • Use direct variable access for assertion state instead of getter subshells in runner hot path

🐛 Bug Fixes

  • Fix misleading error message for assert_not_same and assert_not_equals on failure (#604)
  • Mocking mktemp no longer breaks spy creation (#602)
  • JUnit XML report now conforms to the standard schema
    • Remove non-standard attributes from <testsuite> and <testcase>
    • Add errors="0" attribute and <failure>/<skipped> child elements per spec
    • skipped count now includes both skipped and incomplete tests
    • Convert time values from milliseconds to seconds (float)
    • Strip ANSI escape sequences and invalid XML control characters from failure messages
    • Include actual failure messages in <failure> body

Tests

  • Add unit tests for env.sh, math.sh, colors.sh, test_title.sh, console_header.sh, and doc.sh

👥 Contributors

Checksum

SHA256: dfb53a905b49fe791ac6b63b5cc2109287694346e4300b591ff11c0b08e7898f

Full Changelog: 0.33.0...0.34.0

0.33.0

15 Feb 16:34
0.33.0
380ea5d

Choose a tag to compare

🛠️ Changes

  • Lower minimum Bash version requirement from 3.2 to 3.0
  • Improve parallel test execution performance (30-40% faster on large test suites)

✨ Improvements

  • Display test output (stdout/stderr) on failure for runtime errors
    • Enabled by default; disable with --no-output-on-failure or BASHUNIT_SHOW_OUTPUT_ON_FAILURE=false
  • Add --no-progress flag to suppress real-time progress display (Issue #503)
    • Also available via BASHUNIT_NO_PROGRESS=true environment variable
  • Support # bashunit: no-parallel-tests directive to opt out of test-level parallelism

🐛 Bug Fixes

  • Data providers now work without the function keyword on test functions (Issue #586)
  • Install tests now pass in sandboxed/no-network environments (Issue #582)
  • Parallel test execution now works correctly in strict mode (bash -e -o pipefail)

👥 Contributors

Checksum

SHA256: e81c5c262d2e7296598b823c7d7fda1b54a818f5324cee1d65cc3b074a194ed0

Full Changelog: 0.32.0...0.33.0

0.32.0

12 Jan 07:55
0.32.0
8d58282

Choose a tag to compare

🛠️ Changes

  • Hook output now displays with right-aligned timing and bullet prefix (● set_up_before_script 2.03s)

✨ Improvements

  • Better code coverage HTML report
  • Auto-discover coverage paths from test file names when BASHUNIT_COVERAGE_PATHS is not set
    • tests/unit/assert_test.sh automatically tracks src/assert.sh
    • Removes the need for manual --coverage-paths configuration in most cases
  • --coverage-report-html now defaults to coverage/html when no directory is specified

🐛 Bug Fixes

  • Coverage now excludes control flow keywords (then, else, fi, do, done, esac, ;;, case patterns) from line tracking
  • Coverage HTML report now correctly handles namespaced functions with colons (e.g., bashunit::assert::equals)
  • Coverage data no longer lost when running coverage_test.sh alongside other tests

👥 Contributors

Checksum

SHA256: c0609ee93bc60c60e171cd7a95479f1e900df974f559e874acbbc3e7b925d6a9

Full Changelog: 0.31.0...0.32.0