Closed cloojure closed 1 year ago
Nice to hear from you! Hope you're doing well.
It looks like test-refresh defaults to looking for a test
directory. This default can be overridden at the command line. clojure -M:test-refresh --dir src
in the sample project executes tests.
I had to dig through the code to find that as it looks like it isn't documented (or I can't find it now). The only documentation on it was also in the code and would print to the console with a --help
flag. And that also wasn't documented 🤦 .
$ clojure -M:test-refresh --help
Below are the arguments supported by test-refresh:
-d, --dir DIRNAME Name of the directory containing tests. Specify flag multiple times for specifying multiple test directories. Defaults to "test".
--no-config Run and ignore all .test-refresh.edn files
-c, --config FILENAME Use specified file as a configuration file. Specify flag multiple times to specify multiple files. Later files override values found in earlier files. Defaults to ["~/.test-refresh.edn", ".test-refresh.edn"]
-h, --help Display this help message
OK, I modified my deps.edn and got it to work like so:
:test-refresh {:extra-paths ["src/clj"]
:extra-deps {com.jakemccrary/test-refresh
{:mvn/version "0.25.0"}} :main-opts ["-m" "com.jakemccrary.test-refresh" "--dir" "src" ] }
Looking forward to playing around with deps/cli and slowly transitioning away from Lein.
Thanks for the updated test-refresh.
Alan
On Sat, Jan 21, 2023 at 7:33 PM Jake McCrary @.***> wrote:
Nice to hear from you! Hope you're doing well.
It looks like test-refresh defaults to looking for a test directory. This default can be overridden at the command line. clojure -M:test-refresh --dir src in the sample project executes tests.
I had to dig through the code to find that as it looks like it isn't documented (or I can't find it now). The only documentation on it was also in the code and would print to the console with a --help flag. And that also wasn't documented 🤦 .
$ clojure -M:test-refresh --help
Below are the arguments supported by test-refresh:
-d, --dir DIRNAME Name of the directory containing tests. Specify flag multiple times for specifying multiple test directories. Defaults to "test".
--no-config Run and ignore all .test-refresh.edn files
-c, --config FILENAME Use specified file as a configuration file. Specify flag multiple times to specify multiple files. Later files override values found in earlier files. Defaults to ["~/.test-refresh.edn", ".test-refresh.edn"]
-h, --help Display this help message
— Reply to this email directly, view it on GitHub https://github.com/jakemcc/test-refresh/issues/85#issuecomment-1399395663, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWBOBY2JDERS446L6M2SLTWTSS67ANCNFSM6AAAAAAUCVEPEE . You are receiving this because you authored the thread.Message ID: @.***>
Use the template below when reporting bugs. Please make sure the problem is still a problem with the latest version of lein-test-refresh before submitting.
What version of lein-test-refresh? 0.25.0
What version of Leiningen? n/a: running deps/cli
Can you recreate the issue with a minimal project? Please see: https://github.com/io-tupelo/clj-template-deps-dbg
I like to name my testing namespaces like
tst.demo.core
instead ofdemo.core-test
. It avoids whole hyphen vs. underscore debacle, and it keeps the filename like**/demo/core.clj
for both the source file and the test file. There are other stylistic benefits as well IMHO.Given this, there is little rational for keeping separate
./src
and./test
directories in a project root. I would like to experiment keeping both types of source files under a single./src
root such as:I got this to work with the Cognitect test runner:
However, I cannot figure out a way to make it work with test-refresh:
However, it works great if I keep the testing code under the
./test
root. See https://github.com/io-tupelo/clj-template-deps for example:Am I missing something? Or, does test-refresh have a hard assumption about separate source & testing roots?
Thanks, Alan