>lein cljsbuild test
Compiling ClojureScript.
Running all ClojureScript tests.
phantomjs>
Here is my project.clj:
(defproject chatter-box "0.1.0-SNAPSHOT"
:description "Example chat program to illustrate core.async and enfocus."
:url "http://ckirkendall.github.io/enfocus-site"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[compojure "1.1.5"]
[org.clojure/core.async "0.1.0-SNAPSHOT"]
[ring "1.2.0"]
[com.cemerick/clojurescript.test "0.0.5-SNAPSHOT"]]
:source-paths ["src/client" "src/common" "src/server"]
:test-paths ["src/client" "src/server"
;add source paths for cross compiled code
".generated/clj" ".generated/cljs"]
:plugins [[lein-cljsbuild "0.3.2"]
[com.keminglabs/cljx "0.3.0"]]
; Enable the lein hooks for: clean, compile, test, and jar.
:hooks [leiningen.cljsbuild cljx.hooks]
:main chatter-box.core
:cljsbuild {
; Configure the REPL support; see the README.md file for more details.
:repl-listen-port 9000
:repl-launch-commands {
"phantom" ["phantomjs"
"phantom/repl.js"
:stdout ".repl-phantom-out"
:stderr ".repl-phantom-err"]}
:test-commands
; Test command for running the unit tests in "test-cljs" (see below).
; $ lein cljsbuild test
{"unit" ["phantomjs"
:cljs.testrunner
"resources/private/js/unit-test.js"]}
:builds
[{:id "dev"
:source-paths ["src/client"]
:compiler {:output-to "resources/public/js/main-debug.js"
:optimizations :whitespace
:pretty-print true}}
; This build has the highest level of optimizations, so it is
; efficient when running the app in production.
{:id "prod"
:source-paths ["src/client"]
:compiler {:output-to "resources/public/js/main.js"
:optimizations :advanced
:pretty-print false}}
; This build is for the ClojureScript unit tests that will
; be run via PhantomJS. See the phantom/unit-test.js file
; for details on how it's run.
{:id "test"
:source-paths ["src/client" "test/client"]
:compiler {:output-to "resources/private/js/unit-test.js"
:optimizations :whitespace
:pretty-print true}}]}
;cross compiling code for both clojurescript and clojure
:cljx {:builds [{:source-paths ["src/common" "test/common"]
:output-path "target/generated/clj"
:rules :clj}
{:source-paths ["src/common" "test/common"]
:output-path "target/generated/cljs"
:rules :cljs}]}
:ring {:handler chatter-box.core})
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
I got it working using the following entry (cljx + clojurescript.text + lein-cljsbuild) under :cljsbuild in project.clj:
:test-commands {"unit-tests" ["runners/phantomjs.js" "target/cljs/testable.js"]}
Got the runner script from here:
https://github.com/cemerick/clojurescript.test/blob/master/resources/cemerick/cljs/test/runner.js
The file testable.js is auto generated.
Shantanu
CK
I am using clojurescript.test 0.0.4 with cljx 0.3.0 and lein-cljsbuild 0.3.2.
Shantanu
I did actually look at that but I was trying to get the new setup to work. Looks like it has issues. Also, great job on the modern-cljs! Any chance of adding enfocus to the mix? I bias clearly but I think your enlive tutorial could be move to enfocus with little to no changes. :)
http://ckirkendall.github.io/enfocus-site/
CK
Today, I've been having the same problem as you, I've just an hour ago managed to get it working on a library. Feel free to check out my repo/project.clj if it helps.
https://github.com/andrewmcveigh/cljs-time
https://github.com/andrewmcveigh/cljs-time/blob/master/project.clj
I'm using 0.2.2 and when I run lein cljsbuild test, it only seems to test once.
My settings are:
:cljsbuild {:builds [{:source-paths ["src" "test"]
:compiler {:output-to "target/cljs/testable.js"
:optimizations :whitespace
:pretty-print true}}]
:test-commands {"unit-tests" ["phantomjs" :runner
"this.literal_js_was_evaluated=true"
"target/cljs/testable.js"]}}
I wrote a short blog post on a technique I use to get "auto testing" for ClojureScript.
Forgot the link, whoops! Here it is: http://noprompt.github.io/clojurescript/testing/ruby/2014/01/25/autotesting-clojurescript.html