This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-11
Channels
- # announcements (1)
- # aws (1)
- # babashka (1)
- # beginners (41)
- # bristol-clojurians (2)
- # clara (2)
- # cljs-dev (7)
- # clojure (18)
- # clojure-europe (1)
- # clojure-finland (2)
- # clojure-uk (9)
- # clojurescript (5)
- # community-development (2)
- # data-science (14)
- # events (1)
- # fulcro (12)
- # joker (12)
- # malli (2)
- # reitit (1)
- # xtdb (1)
Hi. I would like to implement a library that runs on both clojure and clojurescript. I would also like to write my unit tests in a way that works in both cases. What would you suggest I use as testing framework? Can I use clojure.test and cljs.test and just use reader conditionals to require them in clj / cljs respectively?
Yes you can, I think even in cljs you can require clojure.test and cljs will resolve it to cljs.test
You can write tests that are nearly identical for both in a .cljc file with reader conditionals for the few differences, if you want.
If you have tests that you want only to run for clj, put them in a .clj test file. Similarly if you have tests that you want only run for class.