bats-testing-patterns
SKILL.md
Bats Testing Patterns
Overview
Bats (Bash Automated Testing System) provides a TAP-compliant testing framework for shell scripts. This skill documents proven patterns for writing effective, maintainable shell script tests that catch bugs early and document expected behavior.
Use this skill when:
- Writing tests for Bash or shell scripts
- Creating test fixtures and mock data for shell testing
- Setting up test infrastructure for shell-based tools
- Debugging failing shell tests
- Integrating shell tests into CI/CD pipelines
Core Testing Patterns
Basic Test Structure
Every Bats test file is a shell script with a .bats extension: