bats-test-scaffolder
SolidGenerate BATS test structure and fixtures for shell script testing with setup/teardown, assertions, and mocking.
Testing & QA 814 stars
53 forks Updated today MIT
Install
Quality Score: 95/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 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
```bash
#!/usr/bin/env bats
# Load test helpers
load 'test_helper/common-setup'
# Setup runs before each test
setup() {
common_setup
# Test-specific setup
export TEST_DIR="$(mktemp -d)"
}
# Teardown runs after each test
teardown() {
# Cleanup
rm -rf "${TEST_DIR}"
}
@test "script displays help with --help" {
run ./script.sh --help
assert_success
assert_output --partial "Usage:"
}
@test "script fails without required argument" {
run ./script.sh
assert_failure
assert_output --partial "Missing required argument"
}
@test "script processes input file" {
cp fixtures/input.txt "${TEST_DIR}/"
run ./script.sh "${TEST_DIR}/input.txt"
assert_success
as...
Details
- Author
- a5c-ai
- Repository
- a5c-ai/babysitter
- Created
- 4 months ago
- Last Updated
- today
- Language
- JavaScript
- License
- MIT
Related Skills
Testing & QA Featured
rtk-tdd
Enforces TDD (Red-Green-Refactor) for Rust development. Auto-triggers on implementation, testing, refactoring, and bug fixing tasks. Provides Rust-idiomatic testing patterns with anyhow/thiserror, cfg(test), and Arrange-Act-Assert workflow.
55,551 Updated today
rtk-ai Testing & QA Featured
tdd-rust
TDD workflow for RTK filter development. Red-Green-Refactor with Rust idioms. Real fixtures, token savings assertions, snapshot tests with insta. Auto-triggers on new filter implementation.
55,551 Updated today
rtk-ai Testing & QA Featured
wordpress-penetration-testing
Assess WordPress installations for common vulnerabilities and WordPress 7.0 attack surfaces.
38,979 Updated today
sickn33