sudo apt install batsrunning tests
bats [file]
#!/usr/bin/env batssimple test case testing script output
@test "verify script output" {
result="$(sh [script] [args])"
[ "$result" = "[expectation]" ]
}test for exit code and message@test "verify exit code and message" {
run sh [script] [args]
[ "$status" -eq 1 ]
[ "$output" = "[expectation]" ]
}https://github.com/sstephenson/bats