this:
Run one Clojure test (not all tests in a namespace), with fixtures, from the REPL
works fine with repl, how can I do this from command line using Leinigen?
You can run tests by using the cljs. test/run-tests macro. This may be done in your REPL or at the end of your file. If you have many test namespaces it's idiomatic to create a test runner namespace which imports all of your test namespaces and then invokes run-tests .
lein test provides the ability to run all tests in a project. lein test <selector> <selector-args> allows a custom selector to be defined by a project's project. clj file in the :test-selectors key. A selector is a function that can look at a namespace or a test var and decide whether a test should run or not.
What you are looking for is probably:
lein test :only my.namespace/my-test
Note that:
lein help test
outputs:
"A default :only test-selector is available to run select tests. For example, `lein test :only leiningen.test.test/test-default-selector` only runs the specified test. A default :all test-selector is available to run all tests."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With