|
3 | 3 | You can run `clojure.test` tests pretty quickly in CIDER. Pressing <kbd>C-c C-t
|
4 | 4 | n</kbd> or <kbd>C-c C-t C-n</kbd> in a source buffer or a REPL buffer will run
|
5 | 5 | 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. |
11 | 22 |
|
12 | 23 | All test commands are available in REPL buffers as well. There you can also use
|
13 | 24 | <kbd>,</kbd> to invoke some of the testing commands.
|
|
0 commit comments