ok. I'm using Atom+ProtoRepl and I just found the command to run the tests.. 😉 thx
😞 I was wrong... using repl the tests are not running... altough it prints as if testing, but no test is ran
...Testing taoensso.encore
Testing io.aviso.writer
Testing clojure.tools.nrepl.misc
Testing clojure.core
Testing clojure.tools.reader.reader-types
Testing clojure.walk
Testing taoensso.truss.impl
Testing flatland.ordered.set
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
@seancorfield do I need to config smthing so that (clojure.test/run-all-tests)
invoke expectations
tests?
@gleisonsilva None of those namespaces would have tests in them. You need to load (`require`) the namespaces that have the tests in them.
It looks like you've only loaded your source (non-test) namespaces.
seens like only the "src" folder has been loaded
how can I tell proto-repl to load "test" folder (in deps.edn there is a alias with that)?
I start my REPL manually and connect ProtoREPL to it -- I haven't had much luck with the built-in CLI / deps.edn
support in ProtoREPL.
So I have an alias :test
which adds just my test dependencies and :extra-paths ["test"]
(and I have :runner
as a separate alias for Cognitect's test runner)
See https://github.com/seancorfield/dot-clojure/blob/master/deps.edn for example.
In a terminal, I run clojure -A:proto:nrepl:test
in my project and once that starts I connect to it in Atom with ctl-, Y and enter the port if it isn't pre-selected.
now I have succeed in load test folder in protorepl
but seens like the 'expect' are not been recognized, see:
it prints Testing...
but Ran 0 tests..
are (clojure.test/run-tests)
able to automatically understand expect
calls in my test namespace? Or do I need to set something special?
right! I got it. Thx
😉 i made it! it is working all through proto-repl now
ProtoREPL's hot keys to run tests do not work with the expectations
namespace style -- as I mentioned above, you need to use named expectations defexpect
from the expectations.clojure.test
namespace instead.
This is why you're having so much trouble.
The original Expectations library did not work properly with clojure.test
or any of the "standard" test tooling (that was all built on top of clojure.test
).
That's why there's a new expectations.clojure.test
namespace, with defexpect
to define named expectations (and its own versions of expect
etc). See https://clojure-expectations.github.io/clojure-test.html
Since you're using the older format of expectations, I'm surprised you're able to get the tests running at all with Cognitect's test runner (I suspect it's mere coincidence -- and the tests just run at JVM shutdown).