Fork me on GitHub
#testing
<
2018-11-22
>
gleisonsilva00:11:07

ok. I'm using Atom+ProtoRepl and I just found the command to run the tests.. 😉 thx

gleisonsilva00:11:14

😞 I was wrong... using repl the tests are not running... altough it prints as if testing, but no test is ran

gleisonsilva00:11:37

...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.

gleisonsilva00:11:52

@seancorfield do I need to config smthing so that (clojure.test/run-all-tests) invoke expectations tests?

seancorfield00:11:34

@gleisonsilva None of those namespaces would have tests in them. You need to load (`require`) the namespaces that have the tests in them.

seancorfield00:11:47

It looks like you've only loaded your source (non-test) namespaces.

gleisonsilva00:11:40

seens like only the "src" folder has been loaded

gleisonsilva00:11:25

how can I tell proto-repl to load "test" folder (in deps.edn there is a alias with that)?

seancorfield01:11:02

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.

seancorfield01:11:42

So I have an alias :test which adds just my test dependencies and :extra-paths ["test"]

seancorfield01:11:59

(and I have :runner as a separate alias for Cognitect's test runner)

seancorfield01:11:56

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.

gleisonsilva01:11:34

now I have succeed in load test folder in protorepl

gleisonsilva01:11:01

but seens like the 'expect' are not been recognized, see:

gleisonsilva01:11:35

it prints Testing... but Ran 0 tests..

gleisonsilva01:11:13

are (clojure.test/run-tests) able to automatically understand expect calls in my test namespace? Or do I need to set something special?

seancorfield02:11:18

No, the old style of expect tests do not work with any clojure.test tooling. You need to change to the new, named expectations style.

gleisonsilva10:11:27

right! I got it. Thx

gleisonsilva01:11:02

😉 i made it! it is working all through proto-repl now

seancorfield02:11:37

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.

seancorfield02:11:00

This is why you're having so much trouble.

seancorfield02:11:43

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).

seancorfield02:11:50

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

seancorfield02:11:34

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).

seancorfield02:11:18

No, the old style of expect tests do not work with any clojure.test tooling. You need to change to the new, named expectations style.