This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-14
Channels
- # adventofcode (107)
- # aleph (1)
- # announcements (8)
- # beginners (57)
- # boot (3)
- # braveandtrue (18)
- # calva (374)
- # cider (6)
- # cljdoc (8)
- # cljs-dev (140)
- # clojure (199)
- # clojure-berlin (5)
- # clojure-europe (3)
- # clojure-finland (1)
- # clojure-hamburg (4)
- # clojure-italy (17)
- # clojure-nl (16)
- # clojure-spec (2)
- # clojure-uk (70)
- # clojurescript (29)
- # component (2)
- # cursive (10)
- # datomic (44)
- # docker (1)
- # figwheel (3)
- # fulcro (13)
- # immutant (2)
- # juxt (5)
- # leiningen (53)
- # nrepl (3)
- # off-topic (7)
- # pedestal (3)
- # re-frame (7)
- # ring (3)
- # ring-swagger (5)
- # rum (5)
- # shadow-cljs (14)
- # spacemacs (6)
- # specter (12)
- # tools-deps (11)
- # unrepl (11)
- # vim (7)
Hi all. Does anyone know what the requirement for :auto-testing is? I’ve tried adding it to a Luminus based project (based on template v3.10.22), but figwheel complains that the key is unrecognized. My goal is to get some sensible Clojurescript testing up and running. I love how testing works in Clojure, but Clojurescript side has been a pain and it feels a bit wrong to move all my logic to cljc to have a good experience. Any help appreciated.
Hi @U1S4F3M4M. That Luminus template uses lein-fighweel, right? I think the :auto-testing
option is only in Figwheel-Main, which is a rewrite of lein-figwheel. But you can do auto-testing with lein-figwheel, too, just configured differently.
I think the :auto-testing
feature basically just sets up another build with its own code entrypoint, HTML host file, and HTTP endpoint to serve it. It also uses [bhauman/cljs-test-display](https://github.com/bhauman/cljs-test-display) to display test results on the page (instead of in console logs).
With lein-figwheel, I think the approach to running cljs tests could be pretty much the same idea, but the config is a bit less automatic. You'd set up a separate :cljsbuild
build for running tests, with its own :output-to
target and its own :main
(something like myapp.core-test
). Another HTML file in your resources/public
would load the JS outputted by the test build and run the tests. It could include cljs-test-display too, see its README for how to add it, it's a one-liner in the test file I think.
You can run both builds in one lein command (something like lein figwheel dev test
).
I'm short on specifics because I haven't done exactly this but hopefully it helps. Try #lein-figwheel for specific help with it maybe, or check out the output of various other lein template projects that may include auto cljs testing.
Hi @U3HMZGQ3S. Thanks for taking the time to answer this on. You are confirming what I had started to suspect. Namely that I should read up on figwheel-main. I was initially not aware that it existed as I’ve happily used Luminus with lein-figwheel working out-of-the-box. But, I always knew that it might bit me down the road not to have set up everything myself… As for the problem I actually ended up moving the critical code to cljc with test coverage, as I might end up using that code from Clojure as well. Thanks again.