This extension adds language support for the Bats (Bash Automated Testing System) testing framework to VS Code.
Bash Automated Testing System (2021) is a community-maintained Bats project.
(c) 2011-2016 Sam Stephenson\ (c) 2017-2021 bats-core organization
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.
\ See bats-core README for documentation on how to use Bats.
Project | version | code snippets | syntax highlighting |
---|---|---|---|
https://github.com/bats-core/bats-core | |||
https://github.com/bats-core/bats-assert | |||
https://github.com/bats-core/bats-support | |||
https://github.com/bats-core/bats-file | |||
https://github.com/lox/bats-mock |
These modules have snippets:
Type BATS:*snippet*
to use snippets.
These modules have syntax highlighting support:
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.
{
"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"
}
}
]
}
}
This extension is published in the VSCode marketplace.
bats
.See Changelog.
Feel free to report any issues.
If you like Bats, you may also like ShellCheck and the VSCode extension
This extension was inspired by sublime-bats.