kaocha
kaocha copied to clipboard
Default ns-pattern "-test$" is confusing
Following README, it’s not clear why after everything is set up no tests have been found. Maybe change default ns-pattern value to ".*", with option to rewrite? Otherwise you might just get stuck, with no idea why it’s not working and how to continue. I spent a great deal of time figuring if it’s a classpath problem or what
Related: #34
I'm ok with changing this. I would generally recommend to stick to the Clojure convention of naming your test namespaces something-test, and to be selective so Kaocha doesn't load more than it needs to, but the current default is confusing. Better to load everything by default, but show in examples how to narrow it down.
I would generally recommend to stick to the Clojure convention of naming your test namespaces
something-test...
Departing from the Java convention, clojure.test 1.10 is more friendly with embedded tests, see API sections "DEFINING TESTS" and "OMITTING TESTS FROM PRODUCTION CODE". AFAIK test code is already being suppressed in ClojureScript under optimised compilation (conditions may apply).
Indeed, not all tests should be embedded within code, but (eg. in Rust) it's really convenient to have unit tests close to the object under test.
Been bitten too, but a fix would also make embedding tests more straightforward.
I was looking over issues with the "first issue only" tag, and I'm not sure we need to do this any more. Thanks to #72, the quickstart is much clearer, (and I've since made that change to the docs) and #34 will help too.
If we still go ahead and do it, I think we should introduce a new #kaocha/v2 reader, so it doesn't affect existing configs that haven't specified ns-pattern.
Agreed that this would be a good candidate for a #kaocha/v2, I've started a ticket to track that: #183.