install
source · Clone the upstream repo
git clone https://github.com/TypedDevs/bashunit
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/TypedDevs/bashunit "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/fix-test" ~/.claude/skills/typeddevs-bashunit-fix-test && rm -rf "$T"
manifest:
.claude/skills/fix-test/SKILL.mdsource content
Fix Test
Systematically debug and fix failing test(s).
Workflow
1. Identify Failures
./bashunit tests/ 2>&1
Parse: which files, which functions, error messages.
2. Categorize Each Failure
- Test bug — test itself is wrong (wrong expected value, bad setup)
- Implementation bug — code doesn't match expected behavior
- Environment issue — missing dependency, wrong fixture path
- Race condition — passes sequential, fails parallel
- Flaky test — network/time/random dependency
3. Fix
- Test bug: correct assertion or setup
- Implementation bug: minimal fix in
, follow TDDsrc/ - Environment: fix
/ fixturesset_up - Race condition: use
for isolation,$temp_dir
for asyncwait - Flaky: mock external dependencies
4. Verify
./bashunit path/to/fixed_test.sh # Specific test ./bashunit tests/ # Full suite ./bashunit --parallel tests/ # Isolation check
5. Prevent Regression
Document root cause. Consider adding edge case tests to prevent recurrence.
Debugging Tips
- Use
to run single test--filter "test_name" - Add
temporarilyecho "DEBUG: $var" >&2 - Check fixtures exist:
ls tests/fixtures/ - Verify mocks:
assert_have_been_called mock_name