This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-10
Channels
- # beginners (140)
- # boot (18)
- # cider (4)
- # cljs-dev (28)
- # clojure (191)
- # clojure-greece (51)
- # clojure-russia (1)
- # clojure-spec (13)
- # clojure-uk (2)
- # clojurescript (38)
- # community-development (26)
- # core-logic (16)
- # cursive (6)
- # datomic (3)
- # defnpodcast (9)
- # editors (1)
- # emacs (1)
- # fulcro (10)
- # immutant (3)
- # jobs-discuss (2)
- # leiningen (17)
- # lumo (24)
- # off-topic (30)
- # quil (12)
- # re-frame (11)
- # reagent (103)
- # remote-jobs (2)
- # shadow-cljs (157)
- # spacemacs (4)
- # unrepl (18)
- # yada (2)
hi guys,
I’m having trouble running lein test
- it finds 0 tests.
I have :test-paths ["src/cljs"]
in my project.clj
Not sure where to start looking
who puts unit tests under src?
@mlatu the normal thing is for tests to be under "test" or perhaps in a cljs project either "test-cljs" or "test/cljs"
(of course if your test files are actually under the "src/cljs" directory, you have some other issue)
where are your files with tests in them? are they clj files or cljs files?
lein test will never run .cljs files
all lein test does is load every clj file under the specified directory, then run all tests that were defined in those files
it doesn't even look at cljs files, you probably want one of the cljs unit testing plugins, which will require some setup (should the tests run in node? should they run via rhino or a browser or?)
"simple" isn't enough for cljs - you need something that can execute them, and leiningen needs to know how to set it up - there's no default
also in my experience most people's cljs code makes assumptions that break in rhino, node is more compatible with a browser env but still different, and automating a browser from the command line isn't a simple thing (there's things that almost work if you set them up though)
I hear good things about lein-doo
for testing cljs, I set up a custom workflow combining its own cljs building profile and a handler on our http server that loads up and runs all the test cljs code in the browser