Test your bash scripts in the fastest and simplest way.
Why bashunit
A lightweight, fast testing framework for Bash 3.0+, focused on developer experience.
It ships 93 assertions plus spies, mocks, data providers, snapshots and more.
Quick start
Install the latest version into your project:
curl -s https://bashunit.com/install.sh | bash
Write a test in tests/example_test.sh:
#!/usr/bin/env bashfunctiontest_bashunit_is_working() {
assert_same "bashunit is working""bashunit is working"
}
Run it:
./lib/bashunit tests/
Prefer learning by doing? Run ./lib/bashunit learn for an interactive tutorial.
Assertions at a glance
One representative example per family — the full catalogue and every signature is at
bashunit.com/assertions, or run bashunit doc locally:
Using an AI coding agent? bashunit.com/ai-agents covers machine-readable
results and the API traps that make generated bash tests pass for the wrong reason. The docs are also
published as plain text at llms.txt and
llms-full.txt, with a drop-in skill at
bashunit-skill.md.
Contribute
Issues, ideas and pull requests are welcome.
See the contribution guide to set up your environment.
The npm package bashunit receives a total of 888 weekly downloads. As such, bashunit popularity was classified as not popular.
We found that bashunit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Cursor removed a malicious Claude Code 2.1.313 extension from its marketplace. Socket examines registry records and the initial claims about its distribution.