reagent-project / reagent-template

A Leiningen template for projects using Reagent.
MIT License
394 stars 55 forks source link

How to run tests? #71

Closed thiagofm closed 9 years ago

thiagofm commented 9 years ago

So, I've create previously a issue asking how, and still didn't managed to.

I've been playing and wrote: https://github.com/thiagofm/smartyper (check it out, should be fun to see one of your babies in action!)

I'm using this reagent template. It's said that I should be able to run clojurescript tests from inside the repl(I need that). Whenever I run lein figwheel, I get:

cljs.user=>

I try to switch to a namespace that contains the test that I want to run, I switch using the function in-ns. I can't call any functions there. But clojure doesn't tell me if this namespace exists or not. Also, I couldn't find a way to check if this namespace is existent.

I promise that once I figure that thing out, I'll contribute back to the community by actually teaching people how to do that.

Can you give me a hand? I currently see a lot of clojure videos in youtube but there's basically no video of somebody working with clojurescript, writing tests and stuff that I usually do in my workflow in another programming language.

yogthos commented 9 years ago

You would try using the Figwheel nREPL, I wrote a walkthrough about that here.

yogthos commented 9 years ago

also just tried smartyper nice project ;)

thiagofm commented 9 years ago

Ok, I've discovered what was the problem. It's actually my smartype.core-test that isn't getting loaded. Other modules work fine. Sorry :-1:

How do I load all tests files inside figwheel? Is there any easy way to do that? A special namespace?

Whoops commented 9 years ago

Just a guess from reading this (https://nvbn.github.io/2015/06/08/cljs-test/) and looking at your project.clj, but I think the issue might be that your tests are not included in your apps source-paths, but instead have their own separate build configuration. You I think you might have to include them for the namespace to be available on the REPL. If not, it might be worth asking on the Figwheel project as well, since it's probably not specific to this template.