TypedDevs/bashunit

A simple yet powerfull testing library for bash scripts.

Shell

433

3,032 commits

updated Sep 30, 2026

See the code

README

Tests Static analysis Editorconfig checker MIT Software License


bashunit

A simple testing framework for bash scripts

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 bash

function test_bashunit_is_working() {
  assert_same "bashunit is working" "bashunit is working"
}

Run it:

./lib/bashunit tests/

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:

Documentation

Full documentation, covering installation options, every feature and examples, lives at bashunit.com.

Shell tab-completion for bash and zsh is available under completions/ — see the installation docs.

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.

assertions
bash
bash-script
mocking
tdd
test-driven-development
testing
testing-framework
unittest
unittest-framework
unittesting
unittesting-library

Significant stargazers

Roger Coll

46 followers · starred Aug 2025

Juliette

1,365 followers · starred Jun 2024

Théo FIDRY

374 followers · starred Jul 2024

Abhishek Keshri

512 followers · starred Feb 2026

TypedDevs/bashunit

A simple yet powerfull testing library for bash scripts.

Shell

433

3,032 commits

updated Sep 30, 2026

See the code

README

Tests Static analysis Editorconfig checker MIT Software License


bashunit

A simple testing framework for bash scripts

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 bash

function test_bashunit_is_working() {
  assert_same "bashunit is working" "bashunit is working"
}

Run it:

./lib/bashunit tests/

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:

Documentation

Full documentation, covering installation options, every feature and examples, lives at bashunit.com.

Shell tab-completion for bash and zsh is available under completions/ — see the installation docs.

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.

assertions
bash
bash-script
mocking
tdd
test-driven-development
testing
testing-framework
unittest
unittest-framework
unittesting
unittesting-library

Significant stargazers

Roger Coll

46 followers · starred Aug 2025

Juliette

1,365 followers · starred Jun 2024

Théo FIDRY

374 followers · starred Jul 2024

Abhishek Keshri

512 followers · starred Feb 2026

Languages

Shell

99.7%