A test rule that invokes the [Bash Automated Testing System](https://github.com/bats-core/bats-core). For example, a `bats_test` target containing a single .bat and basic configuration: ```starlark bats_test( name = "my_test", size = "small", srcs = [ "my_test.bats", ], data = [ "data.bin", ], env = { "DATA_PATH": "$(location :data.bin)", }, args = ["--timing"], ) ``` ## bats_test
bats_test(name, srcs, data, env)
**ATTRIBUTES** | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | srcs | Test files | List of labels | optional | `[]` | | data | Runtime dependencies of the test. | List of labels | optional | `[]` | | env | Environment variables of the action.

Subject to [$(location)](https://bazel.build/reference/be/make-variables#predefined_label_variables) and ["Make variable"](https://bazel.build/reference/be/make-variables) substitution. | Dictionary: String -> String | optional | `{}` |