Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bats-core/bats-vscode
BATS (Bash Automated Testing System) language support for VSCode.
https://github.com/bats-core/bats-vscode
bats language-support shell testing-tools vscode
Last synced: 3 months ago
JSON representation
BATS (Bash Automated Testing System) language support for VSCode.
- Host: GitHub
- URL: https://github.com/bats-core/bats-vscode
- Owner: bats-core
- License: mit
- Created: 2018-06-02T14:03:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T17:41:11.000Z (11 months ago)
- Last Synced: 2024-07-30T09:41:20.143Z (7 months ago)
- Topics: bats, language-support, shell, testing-tools, vscode
- Language: Shell
- Size: 2.43 MB
- Stars: 23
- Watchers: 5
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# BATS (Bash Automated Testing System) for VSCode
[

][marketplace]
[][github]
[][MIT]This extension adds language support for the [Bats] (Bash Automated Testing System) testing framework to [VS Code][vscode].
## ![tada][_tada] Features

- [x] **Bats** language support for VSCode
- [x] Syntax highlighting for core functions
- [x] Syntax highlighting for community modules
- [x] Code Snippets for quick coding for core functions
- [x] Code Snippets for quick coding for community modules[
][Bats]
## ![bat][_bat] Bats
[Bash Automated Testing System (2021)][bats-core] is a [community-maintained][@bats-core] Bats project.
> (c) 2011-2016 [Sam Stephenson][@sstephenson]\
> (c) 2017-2021 [bats-core organization][@bats-core]Bats is a [TAP]-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write behave as expected.
A **`.bats`** test file is a Bash script with special syntax for defining test cases. Under the hood, each test case is just a function with a description.
> ![Note][_information_source] \
> See [bats-core README][bats-readme] for documentation on how to use [Bats].### Bats modules
Project | version | code snippets | syntax highlighting
:--- | ---: | :---: | :---:
| [![bats-core project][badge-core]][bats-core-l] | ![Y][_white_check_mark] | ![Y][_white_check_mark]
| [![bats-assert project][badge-assert]][bats-assert-l] | ![Y][_white_check_mark] | ![Y][_white_check_mark]
| [![bats-support project][badge-support]][bats-support-l] | ![N][_negative_squared_cross_mark] | ![Y][_white_check_mark]
| [![bats-file project][badge-file]][bats-file-l] | ![N][_negative_squared_cross_mark] | ![Y][_white_check_mark]
| [![bats-mock project][badge-mock]][bats-mock-l] | ![N][_negative_squared_cross_mark] | ![Y][_white_check_mark]## ![scissors][_scissors] Snippets
These modules have snippets:
- [x]
- [x]
- [ ]
- [ ]
- [ ]Type `BATS:*snippet*` to use snippets.
[![bats-core snippets][badge-core]][bats-core-l]
- [x] **BATS:env** : shebang.
- [x] **BATS:setup** : Setup function.
- [x] **BATS:teardown** : Teardown function.
- [x] **BATS:load** : Load common code.
- [x] **BATS:bats_load_library** : Load system-wide libraries.
- [x] **BATS:test** : Test case.
- [x] **BATS:status** : Test status code.
- [x] **BATS:output** : Test output.
- [x] **BATS:line** : Test line output.
- [x] **BATS:skip** : Skip test.[![bats-assert snippets][badge-assert]][bats-assert-l]
- [x] **BATS:assert**
- [x] **BATS:assert_output**
- [x] **BATS:assert_line**
- [x] **BATS:assert_success**
- [x] **BATS:assert_failure**
- [x] **BATS:assert_equal**
- [x] **BATS:assert_not_equal**
- [x] **BATS:refute**
- [x] **BATS:refute_output**
- [x] **BATS:refute_line**## ![flashlight][_flashlight] Syntax highlighting
These modules have syntax highlighting support:
- [x]
- [x]
- [x]
- [x]
- [x]### ![art][_art] Color customizations
If you want `Bats` syntax highlighting to look different to `shellscript` syntax, you can change your user preferences or workspace settings (`.vscode/settings.json`).
Default theme, for `shellscript`:

Example after saving the `editor.tokenColorCustomizations` settings below.

Add this to your VS Code settings.
```json
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "keyword.control.bats",
"settings": {
"foreground": "#9f1fd1",
"fontStyle": "italic"
}
},
{
"scope": "support.function.bats",
"settings": {
"foreground": "#d41515",
"fontStyle": "italic"
}
},
{
"scope": "support.variable.bats",
"settings": {
"foreground": "#329432",
"fontStyle": "italic"
}
}
]
}
}
```[
][Bats]
## Installation
### Extension Marketplace
This extension is published in the [VSCode marketplace][marketplace].
1. Run [Install Extensions] from the [Command Palette]
1. Search and choose [**`bats`**][marketplace].### Release Notes
See [Changelog].
### ![exclamation][_exclamation]Known Issues
[][issues]
Feel free to report any [issues][new issue].
## Related Projects
If you like [Bats], you may also like [ShellCheck][shellcheck] and the [VSCode extension][vscode-shellcheck]
This extension was inspired by [sublime-bats].
## ![scroll][_scroll] License
[
][humanstxt]
[MIT]
[Bats]:
[v1.5.0]:
[sBats]:
[@sstephenson]:
[@bats-core]:
[TAP]:
[Bash]:
[bats-readme]:
[marketplace]:
[github]:
[issues]:
[new issue]:
[Changelog]:
[MIT]:
[humanstxt]:[bats-core]:
[bats-assert]:
[bats-support]:
[bats-file]:
[bats-mock]:
[grayhemp-mock]:[bats-core-l]:
[bats-assert-l]:
[bats-support-l]:
[bats-file-l]:
[bats-mock-l]:[badge-core]:
[badge-assert]:
[badge-support]:
[badge-file]:
[badge-mock]:[command palette]:
[install extensions]:
[Visual Studio Code]:
[vscode]:
[shellcheck]:
[vscode-shellcheck]:
[sublime-bats]:[_art]:
[_bat]:
[_construction]:
[_copyright]:
[_exclamation]:
[_flashlight]:
[_information_source]:
[_negative_squared_cross_mark]:
[_scissors]:
[_scroll]:
[_tada]:
[_white_check_mark]: