The answer seems to be that I needed to delete .shadow-cljs as something was stuck in the cache.
However, now I have the problem that my test-runner ns "start" is not called before the tests are run on the first page reload? If any files are updated, it is called before rerunning the tests. The namespace is loaded, so I was able to put (clojure.spec.alpha/check-asserts true) at the top-level, just not in start.
init is called and it should call start if you want, see https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/test/browser.cljs#L21-L23
Ah... I was trying not to copy-pasta and did (def init shadow.test.browser/init)...
why are you creating your own runner ns if you are just calling the original?
I want to enable clojure spec asserts before running the tests. That's the only reason.
For reference, I think this is the cleanest thing that works:
(ns cadro.test-runner
"Override of shadow's test runner just to enable spec check-asserts."
{:dev/always true}
(:require
[clojure.spec.alpha :as s]
[shadow.test.browser :as sb]))
(def start sb/start)
(def stop sb/stop)
(defn ^:export init []
(s/check-asserts true)
(sb/init))you should really just copy the one that exists and adjust it. its tiny and there is a macro issue with the test data
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/test/browser.cljs#L11-L12
this bit could potentially be a problem because its a weird macro
hrmm... ok