bats

Installation
SKILL.md

BATS Testing Framework

BATS (Bash Automated Testing System) is a TAP-compliant testing framework for Bash 3.2+. Think of it as JUnit for Bash—structured, repeatable testing for shell scripts.

Workflow Decision Tree

Creating New Test Suite

  1. Initialize project structure (see "Project Setup" below)
  2. Create test files with .bats extension
  3. Load helper libraries in setup()
  4. Write tests using @test blocks

Writing Tests

  • Testing script output? → Use run + assert_output
  • Testing exit codes? → Use run + assert_success/assert_failure
  • Testing file operations? → Use bats-file assertions
  • Mocking external commands? → See gotchas.md
Installs
1
First Seen
Apr 16, 2026
bats from smithery.ai