Closed alysbrooks closed 3 years ago
I think we should do this on the Clojure side. If people use an incompatible version of ClojureScript, then we may never get to the point where this code is compiled and running, so the error would never show up.
Instead in the -load
implementation for a cljs test suite we can see which clojurescript version is available, and return a testable with a load error if it's too low.
(defmethod ... [testable]
(if ...cljs-version-too-low...
(assoc testable :kaocha.testable/load-error (ex-info "ClojureScript version too low" {:expected "1.10" :got "..."})
...run normally...))
The kaocha machinery should do the rest.
Doing it in -load
may be too late. I keep getting a "No such var: repl/repl-options" even though, as far as I can tell, Clojurescript 1.9 had repl-options
.
Looks good I think!
If you have the wrong version of Clojurescript, you may get unclear errors upon trying to run Kaocha, so it's best to check the version upfront and warn the user.
This is the kaocha-cljs version of Throw error when on a version of Clojure prior to 1.9.. I'm not sure this is the exactly the right approach, as I'm less familiar with this plugin. In particular, I'm wondering whether we want to error out on the Clojure side of this plugin, too.