🍺 BREW Explorer

← all formulae

bats-core

brew install bats-core v1.13.0 MIT

TAP-compliant testing framework for Bash scripts; write tests as annotated shell functions.

Why you might care

Essential for testing Bash scripts and CLI tools in CI/CD pipelines. Bats outputs TAP format, integrating with standard test harnesses and CI systems. Simpler and more maintainable than hand-rolled shell test assertions, with setup/teardown hooks and readable test syntax.

Categories

Alternatives

shunit2 roundup bash_unit
7.6k
30-day installs · #434
23.7k
90-day · #462
80.5k
365-day · #493
6.1k
★ GitHub stars · updated 5d ago

GitHub topics

bash bats junit shell tap testing testing-tools xunit

Links

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [
    "bats"
  ],
  "alternatives": [
    "shunit2",
    "roundup",
    "bash_unit"
  ],
  "build_dependencies": [],
  "categories": [
    "testing",
    "shell"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Bash Automated Testing System",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:35:47+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "bats-core",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-06-15T14:58:53Z",
  "github_readme_excerpt": "[![Latest release](https://img.shields.io/github/release/bats-core/bats-core.svg)](https://github.com/bats-core/bats-core/releases/latest)\n[![npm package](https://img.shields.io/npm/v/bats.svg)](https://www.npmjs.com/package/bats)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/bats-core/bats-core/blob/master/LICENSE.md)\n[![Continuous integration status](https://github.com/bats-core/bats-core/workflows/Tests/badge.svg)](https://github.com/bats-core/bats-core/actions?query=workflow%3ATests)\n[![Read the docs status](https://readthedocs.org/projects/bats-core/badge/)](https://bats-core.readthedocs.io)\n\n[![Join the chat in bats-core/bats-core on gitter](https://badges.gitter.im/bats-core/bats-core.svg)][gitter]\n\n\u003cdiv align=\"center\"\u003e\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/source/assets/dark_mode_cube.svg\"\u003e\n  \u003cimg alt=\"\" src=\"docs/source/assets/light_mode_cube.svg\"\u003e\n\u003c/picture\u003e\n\u003c/div\u003e\n\n# Bats-core: Bash Automated Testing System\n\nBats is a [TAP](https://testanything.org/)-compliant testing framework for Bash\n3.2 or above.  It provides a simple way to verify that the UNIX programs you\nwrite behave as expected.\n\nA Bats test file is a Bash script with special syntax for defining test cases.\nUnder the hood, each test case is just a function with a description.\n\n```bash\n#!/usr/bin/env bats\n\n@test \"addition using bc\" {\n  result=\"$(echo 2+2 | bc)\"\n  [ \"$result\" -eq 4 ]\n}\n\n@test \"addition using dc\" {\n  result=\"$(echo 2 2+p | dc)\"\n  [ \"$result\" -eq 4 ]\n}\n```\n\nBats is most useful when testing software written in Bash, but you can use it to\ntest any UNIX program.\n\nTest cases consist of standard shell commands. Bats makes use of Bash\u0027s\n`errexit` (`set -e`) option when running test cases. If every command in the\ntest case exits with a `0` status code (success), the test passes. In this way,\neach line is an assertion of truth.\n\n## Table of contents\n\n**NOTE** The documentation has moved to \u003chttps://bats-core.readthed",
  "github_repo": "bats-core/bats-core",
  "github_stars": 6122,
  "github_topics": [
    "bash",
    "bats",
    "junit",
    "shell",
    "tap",
    "testing",
    "testing-tools",
    "xunit"
  ],
  "homepage": "https://github.com/bats-core/bats-core",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 7594,
  "installs_365d": 80515,
  "installs_90d": 23702,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "MIT",
  "llm_generated_at": "2026-06-20T23:44:51+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "bats-core",
  "oldnames": [],
  "one_liner": "TAP-compliant testing framework for Bash scripts; write tests as annotated shell functions.",
  "optional_dependencies": [],
  "rank_30d": 434,
  "rank_365d": 493,
  "rank_90d": 462,
  "raw_hash": "218dd9e0c7208e94",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/b/bats-core.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": null,
  "version_stable": "1.13.0",
  "versioned_formulae": [],
  "why_use_this": "Essential for testing Bash scripts and CLI tools in CI/CD pipelines. Bats outputs TAP format, integrating with standard test harnesses and CI systems. Simpler and more maintainable than hand-rolled shell test assertions, with setup/teardown hooks and readable test syntax."
}