File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
doc/modules/ROOT/pages/testing Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,22 @@ you can set the variable `cider-test-infer-test-ns` to a function that
88
88
takes the current namespace and returns the matching test namespace
89
89
(which may be the same as the current namespace). This provides
90
90
complete flexibility to structure your test suite using whatever
91
- conventions you might want.
91
+ conventions you might want. Here's how you can configure the test running
92
+ to look for `some.test-ns` instead of `some.ns-test`:
93
+
94
+ [source,lisp]
95
+ ----
96
+ (defun cider-custom-test-ns-fn (ns)
97
+ "For a NS, return the test namespace, which may be the argument itself.
98
+ This uses the convention of prepending 'test-' to the namespace name."
99
+ (when ns
100
+ (let ((prefix "test-"))
101
+ (if (string-prefix-p prefix ns)
102
+ ns
103
+ (concat prefix ns)))))
104
+
105
+ (setq cider-test-infer-test-ns #'cider-custom-test-ns-fn)
106
+ ----
92
107
93
108
If your individual tests are not defined by `deftest` or `defspec`, CIDER will
94
109
not recognize them when searching for a test at point in `cider-test-run-test`.
You can’t perform that action at this time.
0 commit comments