Skip to content

Commit d9096e6

Browse files
committed
Add a few notes about test namespace inference to the manual
1 parent 164ffa2 commit d9096e6

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

doc/running_tests.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
You can run `clojure.test` tests pretty quickly in CIDER. Pressing <kbd>C-c C-t
44
n</kbd> or <kbd>C-c C-t C-n</kbd> in a source buffer or a REPL buffer will run
55
the tests for the namespace you're currently in. CIDER is smart enough to figure
6-
out the namespace containing the tests. You can also run all loaded tests with
7-
<kbd>C-c C-t l</kbd> or <kbd>C-c C-t C-l</kbd> and all tests within a project
8-
with <kbd>C-c C-t p</kbd> or <kbd>C-c C-t C-p</kbd> (note that this will load
9-
**all** namespaces in your project). Using <kbd>C-c C-t t</kbd> or <kbd>C-c C-t
10-
C-t</kbd>, you can execute only the test a point.
6+
out the namespace containing the tests. The inference logic works in a pretty
7+
simple manner - if you're in an implementation namespace (e.g. `some.ns`) CIDER
8+
will try to find a matching test namespace (by default `some.ns-test`) and run
9+
the tests there. On the other hand - if you're in something that looks like a
10+
test namespace (e.g. `some.ns-test`), then the command will simply run the tests
11+
in that namespace. From time to time, however, you might want to suppress the
12+
test namespace inference logic (e.g. you have some tests in the implementation
13+
namespace that were defined with `clojure.test/with-test`)
14+
- in such cases you should use <kbd>C-u C-c C-t C-n</kbd>, which will simply run
15+
whatever tests are present in the currently visited/active namespace.
16+
17+
You can also run all loaded tests with <kbd>C-c C-t l</kbd> or <kbd>C-c C-t
18+
C-l</kbd> and all tests within a project with <kbd>C-c C-t p</kbd> or <kbd>C-c
19+
C-t C-p</kbd> (note that this will load **all** namespaces in your
20+
project). Using <kbd>C-c C-t t</kbd> or <kbd>C-c C-t C-t</kbd>, you can execute
21+
only the test a point.
1122

1223
All test commands are available in REPL buffers as well. There you can also use
1324
<kbd>,</kbd> to invoke some of the testing commands.

0 commit comments

Comments
 (0)