| name | bats-test-scaffolder |
| description | Generate BATS test structure and fixtures for shell script testing with setup/teardown, assertions, and mocking. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
| graph | {"domains":["domain:software-engineering"],"specializations":["specialization:cli-mcp-development"],"skillAreas":["skill-area:cli-design","skill-area:e2e-testing"],"roles":["role:backend-engineer","role:platform-engineer"],"workflows":["workflow:feature-development"],"topics":["topic:developer-experience"]} |
BATS Test Scaffolder
Generate BATS test structure for shell script testing.
Capabilities
- Generate BATS test files
- Create setup and teardown fixtures
- Implement custom assertions
- Set up mocking helpers
- Configure test isolation
- Generate test helpers
Usage
Invoke this skill when you need to:
- Set up BATS testing for shell scripts
- Create test fixtures and helpers
- Implement mock functions
- Generate test cases
Generated Test Structure
tests/
├── bats/
│ └── bats-*.bash # BATS submodules
├── test_helper/
│ ├── common-setup.bash # Common setup
│ └── mocks.bash # Mock helpers
├── fixtures/
│ ├── input.txt # Test fixtures
│ └── expected.txt
└── *.bats # Test files
Test File Template
load
() {
common_setup
TEST_DIR=
}
() {
-rf
}
@ {
run ./script.sh --
assert_success
assert_output --partial
}
@ {
run ./script.sh
assert_failure
assert_output --partial
}
@ {
fixtures/input.txt
run ./script.sh
assert_success
assert_output --partial
}
@ {
run ./script.sh -o fixtures/input.txt
assert_success
assert_file_exists
}
@ {
special_file=
>
run ./script.sh
assert_success
}