Skip to content

Commit 7d7291a

Browse files
committed
Improve test runner documentation
Didn't explain some useful features explained by the command help
1 parent 82e9913 commit 7d7291a

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

content/documentation/testing.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,24 @@ Test can be defined by using the `deftest` macro. This macro is like a function
7575

7676
Tests can be run using the `./vendor/bin/phel test` command. Tests are looked up recursively in all directories set by [setTestDirs](/documentation/configuration/#testdirs) configuration option which defaults to `tests/`.
7777

78-
If you want to run the test manually, the `run-tests` function can be used. As arguments, it takes a map of options (that can be empty) and one or more namespaces that should be tested.
78+
Pass filenames as arguments to the `phel test` command to run tests in specified files only:
79+
80+
```bash
81+
./vendor/bin/phel test tests/main.phel tests/utils.phel
82+
```
83+
84+
To filter tests that should run by name, `--filter` command line argument can be used:
85+
86+
```bash
87+
./vendor/bin/phel test tests/utils.phel --filter my-test-function
88+
```
89+
90+
Test report can be set to more verbose TestDox format showing individual test names with `--testdox` flag. Output can also be suppressed with `--quiet` flag to only include errors or silenced fully with `--silent` flag.
91+
92+
See more options available by running `./vendor/bin/phel test --help`.
93+
94+
95+
If you want to run tests from Phel code, the `run-tests` function can be used. As arguments, it takes a map of options (that can be empty) and one or more namespaces that should be tested.
7996

8097
```phel
8198
(run-tests {} 'my\ns\a 'my\ns\b)

0 commit comments

Comments
 (0)