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.
80
Quality
73%
Does it follow best practices?
Impact
90%
1.04xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/bats-testing-patterns/SKILL.mdTest project structure and setup/teardown
Bats shebang
100%
100%
Tests directory layout
75%
100%
Fixtures subdirectory
100%
100%
Test helper file
100%
100%
Load test helper
100%
100%
setup() with mktemp
100%
100%
teardown() cleanup
100%
100%
BATS_TEST_DIRNAME usage
100%
100%
run command used
100%
100%
Exit code assertions
100%
100%
Output assertions
100%
100%
Failure path tests
70%
100%
Without context: $0.6978 · 2m 52s · 26 turns · 71 in / 11,752 out tokens
With context: $1.0705 · 3m 37s · 34 turns · 288 in / 14,106 out tokens
Bats assertions and command mocking
run command
100%
100%
$status assertion
100%
100%
$output assertion
100%
100%
PATH-based command stubs
100%
100%
Stub script creation
100%
100%
Function mock with export -f
100%
100%
Failure path tested
100%
100%
Error output checked
100%
100%
setup() stubs directory
100%
100%
teardown() cleanup
100%
100%
skip for missing tools
0%
0%
$lines usage
0%
0%
Without context: $1.0976 · 4m 53s · 32 turns · 81 in / 17,849 out tokens
With context: $1.0239 · 3m 32s · 41 turns · 342 in / 12,138 out tokens
CI/CD integration and shell compatibility
GitHub Actions workflow
100%
100%
npm bats install in CI
0%
100%
CI test execution
100%
100%
Makefile test target
100%
100%
Makefile test-verbose target
62%
50%
Makefile test-tap target
100%
100%
Makefile parallel target
62%
50%
Shell compatibility test bash
100%
100%
Shell compatibility test sh
100%
100%
Skip on missing shell
0%
0%
setup_file() usage
100%
100%
teardown_file() usage
100%
100%
TAP output in CI
100%
100%
Without context: $0.6226 · 2m 27s · 24 turns · 73 in / 8,735 out tokens
With context: $1.1465 · 6m 33s · 44 turns · 394 in / 11,856 out tokens
9c177eb
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.