跳到正文
cccskills
免费在 GitHub 公开

bats

Use this skill when the user wants to write or run Bash shell tests — TAP-compliant test suites, CI integration, mocking, and parallel test execution.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli星标 56(GitHub 56 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md1.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

bats Plugin

Bash Automated Testing System. Write unit and integration tests for shell scripts with readable syntax, TAP output, and first-class CI support.

Commands

  • bats <resource> <action> — Execute bats commands
  • bats test run — Run a bats test file or test suite
  • bats _ _ — Passthrough to bats CLI

Installation

npm install -g bats
# or
brew install bats-core
# Debian/Ubuntu: apt install bats

Basic Usage

# Run a single test file
bats test/example.bats

# Run all tests in a directory
bats test/

# Count tests without running
bats --count test/

Common Patterns

# Filter tests by name pattern
bats --filter "login" test/

# Parallel execution
bats --jobs 4 test/

# TAP output for CI
bats --tap test/

# JUnit XML for reporting
bats --formatter junit test/ > report.xml

Writing Tests

# example.bats
@test "addition works" {
  result=$(echo $((2 + 2)))
  [ "$result" -eq 4 ]
}

Usage Examples

  • "Run all Bash tests in the test/ directory"
  • "Filter bats tests matching 'deploy'"
  • "Output bats results in TAP format for CI"

SuperCLI

sc bats test run test/example.bats
sc bats _ _ --filter "auth" test/
sc plugins learn bats

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use this skill when the user wants to use 100-exercises-to-learn-rust.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3

免费

Use this skill when the user wants to use 2to3, cli tool: 2to3.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3-2.7

免费

Use this skill when the user wants to use 2to3-2.7, cli tool: 2to3-2.7.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3-3.11

免费

Use this skill when the user wants to use 2to3-3.11, cli tool: 2to3-3.11.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

411toppm

免费

Use this skill when the user wants to use 411toppm, cli tool: 411toppm.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

53AIHub

免费

Use this skill when the user wants to use 53AIHub.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

查看 javimosch 的全部技能

报告此技能的问题