bats-testing-patterns

Installation
Summary

Comprehensive testing framework for shell scripts using Bats with patterns, fixtures, and CI/CD integration.

  • Covers core Bats concepts including test syntax, assertion patterns for exit codes and output, and setup/teardown lifecycle management
  • Provides mocking and stubbing strategies for external commands, functions, and environment variables to isolate units under test
  • Includes fixture management patterns, error condition testing, and shell compatibility validation across bash, sh, and dash
  • Demonstrates CI/CD integration with GitHub Actions and Makefile examples, plus parallel execution and test helper utilities
SKILL.md

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.

When to Use This Skill

  • Writing unit tests for shell scripts
  • Implementing test-driven development (TDD) for scripts
  • Setting up automated testing in CI/CD pipelines
  • Testing edge cases and error conditions
  • Validating behavior across different shell environments
  • Building maintainable test suites for scripts
  • Creating fixtures for complex test scenarios
  • Testing multiple shell dialects (bash, sh, dash)

Bats Fundamentals

What is Bats?

Related skills

More from wshobson/agents

Installs
5.9K
Repository
wshobson/agents
GitHub Stars
35.3K
First Seen
Jan 20, 2026