bats-testing-patterns - Write maintainable Bash tests with Bats
Provides patterns for testing Bash and shell scripts with Bats, including assertions, fixtures, mocking, setup/teardown, and CI integration.
Tags
Updated: 2026-11-05Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Structure Bats test files
- Assert exit codes
- Verify command output
- Test file operations
- Create isolated fixtures
- Mock functions and commands
- Configure setup and teardown
- Integrate tests with CI
Inputs
- Bash or shell scripts
- Test fixtures and mock data
- Test configuration
- Target operating system
Outputs
- Bats test files
- Assertion results
- Test fixture files
- Mock command files
- CI test configuration
Requirements
- Bats testing framework
- Bash or shell environment
- Executable test dependencies
