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
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
@defa try renaming test.edn
to tests.edn
Thanks man, what a stupid mistake of me! Didn’t notice the s
…
not the first person this happens to... maybe we should have a warning for that 🙂
@plexus good idea :thumbsup:
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)
BTW: I’m trying to add ClojureScript tests to a re-natal based project.
that looks like a version mismatch, not sure of which project but I'm guessing clojurescript
make sure you're on the latest version
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)
core_test.cljs
:
(ns foo.core-test
(:require [clojure.test :refer :all]
))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
…
Caused by: clojure.lang.ExceptionInfo: Don't know how to create ISeq from: clojure.lang.Keyword at line 1 test/foo/core_test.cljs
ClojureScript doesn't support :refer :all
try :refer [deftest testing is]
oops.