Plugin enabling Bats to source and test Zsh scripts.
This package is available on the npm registry as bats-zsh
.
npm install -D bats bats-support bats-zsh
This project provides the following functions:
Used to set or change global variables in the sourced files.
@test 'say_my_name() outputs \$MY_NAME'{
zsource path/to/zsh-file.sh
zrun say_my_name
[ "$output" = "You don't have a name" ]
zset MY_NAME="David"
zrun say_my_name
[ "$output" = "Your name is David" ]
}
- Clone this repository:
git clone https://github.com/targendaz2/bats-zsh.git
- Install global dependencies: Node.js, ShellCheck, & Zsh
- Install project dependencies:
yarn install
- Run shellcheck:
yarn lint
- Run tests:
yarn test
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This package is licensed under the Creative Commons Zero v1.0 Universal License.