Fork me on GitHub
#squint
<
2024-01-13
>
Adam Helins13:01:58

Is it likely that Squint will support clojure.test?

👀 1
borkdude14:01:32

I don't know yet. What I did in one project is hack together a couple of macros such that the tests could run in both cljs and squint. https://github.com/nextjournal/clojure-mode/blob/main/src-squint/nextjournal/clojure_mode_tests/macros.cljc Note that these macros are highly specific to this project. such that all of these (specific) tests run with squint: https://github.com/nextjournal/clojure-mode/blob/main/test/nextjournal/clojure_mode_tests.cljc

borkdude14:01:50

I've briefly tried to port cljs.test, but there is one issue with dynamic vars and the way they work in CLJS. CLJS "namespaces" or "vars" are based on the idea that you can mutate them from everywhere. E.g.: (set some-other-namespace/*dynvar* 3) which translates into some_other_namespace._STAR__dynvar_STAR_ = 3. But since squint embraces ES6, this poses a challenge, since ES6 modules don't let you do this

borkdude14:01:09

If a project isn't intended to be ran with regular CLJS, then I would choose what most JS devs currently choose probably, whatever that may be

borkdude14:01:13

or heck, maybe you can use those solutions in regular cljs too