cider
                                
                                 cider copied to clipboard
                                
                                    cider copied to clipboard
                            
                            
                            
                        Support `cider-test-run-test` from the `src` NS
Presently, this can only be called from the test NS.
It would be nice if you could call cider-test-run-test from the src NS, instead of having to run the whole cider-test-run-ns-tests.
This should be possible if your deftest function is named consistently with the source function. So with point on source function foo, invoking cider-test-run-test would look for a corresponding test named foo or foo-test (considering that the style guide now now encourages it).
The only alternative I see now is using -with-filters but that's not too convenient.
That's a good idea and it should be fairly simple to implement.
Hi, I'd really like to work on this if there is still a desire for this functionality.
From my understanding, the desired functionality is for cider-test-run-test to function in a similar way to cider-test-run-ns-tests by searching for the foo-test namespace, but only for the single test at point instead of all tests in the ns?
I think the use case is the following:
- I'm the foons
- There I'm in the definition of bar(e.g. a function)
- I run cider-test-run-testand it finds the matching testbar-testin a namespace calledfoo-testand runs it.
Seems to me the third bullet should read:
- I run cider-test-run-testand it finds the matching test functionbar-testin a namespace calledfoo-testand runs it.
CIDER master / 20230926.1139 features a revamped cider-test-run-test (run test at point).
Now, it will run the first valid test found at point for:
- the current *cider-test-report*failure
- deftests, and deftest-like forms (cider-test-defining-formsis no longer necessary and now deprecated) in the current namespace
- :testmetadata that may be present in vanilla defns
- deftests for the current src/defn, as found (and configurable) bycider-test-infer-test-ns- We search for a var named foo-testin that inferred ns, falling back tofoo
 
- We search for a var named 
Docs: https://docs.cider.mx/cider/testing/running_tests.html