BATS (Bash Automated Testing System) for VSCodeThis extension adds language support for the Bats (Bash Automated Testing System) testing framework to VS Code.
|
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 | ![]() |
![]() |
Snippets
These modules have snippets:
- [x] https://github.com/bats-core/bats-core
- [x] 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
Type BATS:*snippet*
to use snippets.
- [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.
- [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
Syntax highlighting
These modules have syntax highlighting support:
- [x] https://github.com/bats-core/bats-core
- [x] https://github.com/bats-core/bats-assert
- [x] https://github.com/bats-core/bats-support
- [x] https://github.com/bats-core/bats-file
- [x] https://github.com/lox/bats-mock
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.
{
"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"
}
}
]
}
}
Installation
Extension Marketplace
This extension is published in the VSCode marketplace.
- Run Install Extensions from the Command Palette
- Search and choose
bats
.
Release Notes
See Changelog.
Known Issues
Feel free to report any issues.
Related Projects
If you like Bats, you may also like ShellCheck and the VSCode extension
This extension was inspired by sublime-bats.