You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/documentation/testing.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,24 @@ Test can be defined by using the `deftest` macro. This macro is like a function
75
75
76
76
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/`.
77
77
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.
0 commit comments