# Testing Scripts with bats

A test is a small script that runs yours and checks the result; bats runs a file of them, each written with @test, run and checks on $status and $output, in a fresh folder from setup, and reports each one as passed or failed, with the line that failed.

![Cheat sheet for the lesson Testing Scripts with bats: A test is a small script that runs yours and checks the result; bats runs a file of them, each written with @test, run and checks on $status and $output, in a fresh folder from setup, and reports each one as passed or failed, with the line that…](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/f6442638ade54d958dac914741ee5edb.webp)

- Category: Bash
- Level: Freelancer
- Tags: assertion, bats, linux, Test Runner, unit-test, unix
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-testing-with-bats-cheat-sheet
