bats-core Run Configurations
bats-core tests are run via “Run Configurations”, which is a feature of your JetBrains IDE. Please refer to JetBrains' help to learn more about it.
You can configure these properties for bats-core run configurations. They correspond to the available command line options of bats-core.
- Test data path
- The file to a
.batsfile or a directory, which contains
- Test name pattern
- A regular expression to define the tests, which should be executed in the source defined by Test data path .
- If this is enabled and Test data path points to a directory, then
.batsfiles will be searched recursively in the directory and all sub directories. Disable this if you only want to limit the test search to just the directory you specified.
- Number of parallel jobs
- This defines how many tests are run in parallel. The GNU parallel command has to be installed to use this feature.
- Interpreter path
- bats-core is a Bash script and needs a Bash interpreter to run. This setting defines the path to the interpreter, which should be used.
- By default, the default Bash interpreter is used, which is defined in your settings. If you want to override this, then use this property to specify your own path. Please note, that this might make it hard to share bats-core run configurations within your team.
- Program arguments
- The arguments to pass to the bats-core test runner. This shouldn’t be needed, but still allows you to pass special flags if you’re doing something special here.
- Working directory
- The working directory for the bats-core test runner. By default, it’s the directory, where your source is located. If the source is a file, then it’s the parent directory. If the source is a directory, then it’s also used as working directory.
- Environment variables
- This allows you to define the environment variables of your test runner. For example, it’s possible that some tests expect a specific environment. This allows you to define this.
- Add interpreter directory to $PATH
- This adds the directory, where the interpreter is located, to $PATH before bats–core is executed. If the directory is already in
$PATH, then it’s not added again.
- This is especially useful on Windows, where bats-core execution would fail otherwise. For example, if you’re interpreter is
C:\\Program Files\\Git\\bin\bash.exe, then
C:\\Program Files\\Git\\bin\is added to your $PATH environment as first entry.