Running bats-core Tests
There are several ways to run bats-core tests:
How to Run All Tests in a Directory
Choose
Run ‘All tests’
in the context menu on the directory. This creates a new bats-core run
configuration to execute all tests in all .bats
files in this directory and all sub directories.
![](/pngs/bats-core/run_all_tests.zh-cn_400.0e0ffa00ab1b989c9866e534daaa0b12.png)
How to Run All Tests in a File
Click on the first green arrow gutter icon in the file and choose
All tests
in the context menu. This
creates and runs a new bats-core run configuration for the current file.
![](/pngs/bats-core/gutter_all_tests.zh-cn_400.ee98b03e52baab7ee8f0309a0d2c95ca.png)
How to Run a Single Test
Click on the green arrow gutter icon in the file and choose
Run ‘your test name’
in the context menu. This
creates and runs a new bats-core run configuration for only this function.
![](/pngs/bats-core/gutter_single_test.zh-cn_400.7a687d61fa874ff9e4fbafb6b9723621.png)