
Bats Testing Patterns
from ordinary-claude-skills154
Practical patterns and examples for writing maintainable unit tests for shell scripts using Bats (Bash Automated Testing System).
What it does
Provides a comprehensive guide to using Bats for unit testing shell scripts: installation, file structure, setup/teardown, assertion patterns, fixtures, mocking/stubbing, and CI integration. Includes numerous example test snippets and CI workflow examples to help teams adopt test-driven practices for shell utilities.
When to use it
Use this skill when you need reliable testing for shell scripts or CI steps: validating scripts across environments, writing regression tests for deployment helpers, or integrating shell tests into GitHub Actions and other CI systems. Good for developers writing cross-shell tools or maintaining critical build scripts.
What's included
- Scripts: none embedded (has_scripts=false)
- References: links to bats-core and docs, plus TAP protocol resources (has_references=false but in-text links present)
- Instructions: concrete example tests, setup/teardown patterns, fixture management, mocking/stubbing approaches, and CI workflow snippets.
Compatible agents
Useful for code-assistant agents that operate on repositories and CI configs (Copilot, Claude Code, GitHub Copilot). The examples are shell-native and CI-focused.
Tags
Information
- Repository
- ordinary-claude-skills
- Stars








