Shellspec
A full-featured BDD unit testing framework for bash, ksh, zsh, dash and all POSIX shells
Install / Use
/learn @shellspec/ShellspecREADME
ShellSpec: full-featured BDD unit testing framework
ShellSpec is a full-featured BDD unit testing framework for dash, bash, ksh, zsh and all POSIX shells that provides first-class features such as code coverage, mocking, parameterized test, parallel execution and more. It was developed as a dev/test tool for cross-platform shell scripts and shell script libraries. ShellSpec is a new modern testing framework released in 2019, but it's already stable enough. With lots of practical CLI features and simple yet powerful syntax, it provides you with a fun shell script test environment.
Version 0.28.0 has a lot of enhancements in the CLI. It is basically compatible, but there are some changes that you need to be aware of. See Migration Guide to Version 0.28.0 for details.
Thank you for your interest in ShellSpec. Please visit 🚩the official website to know the impressive features!
Let's have fun testing your shell scripts! (Try Online Demo on your browser).
Latest Update.
See CHANGELOG.md
NOTE: This documentation contains unreleased features. Check them in the changelog.
Table of Contents <!-- omit in toc -->
- Supported shells and platforms
- Requirements
- Installation
- Tutorial
- ShellSpec CLI
- Project directory
- Typical directory structure
- Options file
.shellspec- project options file.shellspec-local- user custom options file.shellspec-basedir- specfile execution base directory.shellspec-quick.log- quick execution logreport/- report file directorycoverage/- coverage reports directoryspec/- (default) specfiles directory- <HELPERDIR> (default:
spec/)
- Specfile (test file)
- DSL syntax
- Basic structure
- Pending, skip and focus
Pending- pending exampleSkip- skip example- ['x' prefix for example group an


