0

I am trying to use TDD while learning pedestal, but I am stuck on how to write and execute tests (lein test) on .cljs files. I can't figure out where the tests would belong, and if it is possible to write theme in simple clojure or if I have to write them in clojureScript and run them in the browser.

Catalyst
  • 3,143
  • 16
  • 20

1 Answers1

0

Take a look at https://github.com/taylorSando/pedestal-todo/blob/master/test/todo/test/behavior.clj for examples of how to run tests against Pedestal apps, particularly the use of deftest in conjunction with clojure.test. I think most of your tests will be fine to be written in standard Clojure unless you are testing ClojureScript specific functionality.

People have been using Midge to test their Pedestal apps.

A similar problem was also discussed on the pedestal-users group.

Daniel Compton
  • 13,878
  • 4
  • 40
  • 60
  • I'm still restricted to testing only pure clojure fuctions with these, maybe i can just make the .cljs files .clj and use ^:shared that seems to do what I need unless I start plugging into jQuery or something. – Catalyst Oct 14 '13 at 20:14