bats-testing-patterns
/bats-testing-patterns
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
- Author
- rmyndharis ↗
- Repository
- antigravity-skills ↗
- Licence
- MIT
- Last repository change
- 07.11.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 07.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
Original author description
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
How it works
- Use this skill when
- Do not use this skill when
- Instructions
- Resources
SKILL.md preview
--- name: bats-testing-patterns description: Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities. --- # Bats Testing Patterns Comprehensive guidance for writing comprehensive unit tests for shell scripts using Bats (Bash Automated Testing System), including test patterns, fixtures, and best practices for production-grade shell testing. ## Use this skill when - Writing unit tests for shell scripts - Implementing TDD for scripts - Setting up automated testing in CI/CD pipelines - Testing edge cases and error conditions - Validating behavior across shell environments ## Do not use this skill when - The project does not use shell scripts - You need integration tests beyond shell behavior - The goal is only linting or formatting ## Instructions - Confirm shell dialects and supported environments. - Set up a test structure with helpers and fixtures. - Write tests for exit codes, output, and side effects. - Add setup/teardown and run tests in CI. - If detailed examples are required, open `resources/implementation-playbook.md`. ## Resources - `resources/implementation-playbook.md` for detailed patterns and examples.
Files in this package (2)
- SKILL.md 1 KB
- resources/implementation-playbook.md 11 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · rmyndharis/antigravity-skills | 100 | MIT |
| FrancoStino/opencode-skills-collection | 100 | MIT |
| rootcastleco/rei-skills | 100 | MIT |
| wshobson/agents | 100 | MIT |
| HermeticOrmus/LibreUIUX-Claude-Code | 95 | MIT |
Database snapshot: 13.11.2026 · package version 382c8a2e9fef (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100bats-testing
Configures Bats-core (Bash Automated Testing System) for testing CLI tools, shell scripts, and Unix programs - `.bats` test files with `@test` blocks, `run` to capture command exit + output, `[ \"$status\" -eq 0 ]` and `[ \"$output\" = ... ]` assertions, `setup`/`teardown`… - 100bats-testing
Use when writing shell-native tests for CLI tools, sourced Bash libraries, or REST APIs, especially when process boundaries, shell state, and exit/output behavior must be verified end-to-end. - 100bash-script-tests
Use together with bash-script-kiss when the user asks for tests for a bash script: a bats file in tests/ and fake external commands in tests/stubs/. - 100shell-script-review
Review shell scripts for security, correctness, maintainability, and Bats suite pairing (TEST-00) with emphasis on operational safety. Use when reviewing shell script PRs requiring judgment beyond static checks, including whether paired Bats suites were added or updated per TEST-00. - 100shell-script-validation
Validate shell scripts with bash -n and shellcheck for syntax safety and maintainability checks. Does not enforce Bats suite pairing (TEST-00) — companion stem `bats` covers pairing rules. Use when committing script changes, running CI validation, or debugging shellcheck findings in PRs. - 100bats-test-conventions
WHAT: Conventions for bats tests in this repo. WHEN: User asks to add or edit a `.bats` test file anywhere under tests/. DO-NOT: Put tests under tests/bin/ instead of mirroring the source path; invent new helper names when common.bash already has one; rely on the host's real…