Fork me on GitHub
#kaocha
<
2019-11-14
>
defa14:11:44

I need some help with kaocha and ClojureScript… my test.edn looks like this:

#kaocha/v1
{:tests [{:id          :unit-cljs
          :type :kaocha.type/cljs
          :test-paths  ["test"]
          }]}
and I try to run the tests with:
lein kaocha unit-cljs

defa14:11:04

Error:

No such suite: :unit-cljs, valid options: :unit.
Error encountered performing task 'run' with profile(s): 'base,system,user,provided,dev,kaocha'
Suppressed exit

miikka14:11:13

@defa try renaming test.edn to tests.edn

defa14:11:37

Thanks man, what a stupid mistake of me! Didn’t notice the s

plexus14:11:27

not the first person this happens to... maybe we should have a warning for that 🙂

defa14:11:55

@plexus good idea :thumbsup:

defa14:11:13

Next problem:

Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: PrintWriter-on in this context, compiling:(kaocha/cljs/queue_eval_loop.clj:59:38)
        at clojure.lang.Compiler.analyze(Compiler.java:6792)
        at clojure.lang.Compiler.analyze(Compiler.java:6729)

defa14:11:35

BTW: I’m trying to add ClojureScript tests to a re-natal based project.

plexus14:11:57

that looks like a version mismatch, not sure of which project but I'm guessing clojurescript

plexus14:11:06

make sure you're on the latest version

defa15:11:17

Okay, makes a difference, but 🙈 next problem:

$ lein kaocha unit-cljs

[E]
Randomized with --seed 510488758

ERROR in unit-cljs (analyzer.cljc:3849)
Exception: clojure.lang.ExceptionInfo: null
#:clojure.error{:source #object[java.io.File 0x3f498899 "test/foo/core_test.cljs"], :line 1, :column 1, :phase :compilation}
 at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic (analyzer.cljc:3849)
    cljs.analyzer$analyze_seq_STAR__wrap.invoke (analyzer.cljc:3848)

defa15:11:56

core_test.cljs:

(ns foo.core-test
  (:require [clojure.test :refer :all]
            ))

(deftest a-test
  (testing "FIXME, I fail."
    (is (= 0 1))))

defa15:11:45

Caused by: clojure.lang.ExceptionInfo: Don't know how to create ISeq from: clojure.lang.Keyword at line 1 test/foo/core_test.cljs

miikka15:11:32

ClojureScript doesn't support :refer :all

miikka15:11:43

try :refer [deftest testing is]

defa15:11:42

… copy paste error I didn’t notice. Sorry and thanks a lot @miikka & @plexus!